Verify that the email address is a PayPal user

I want to verify that the email address is a PayPal user. Is there an API call for this?

Is there a ruby ​​lib that does this?

thank

+5
source share
2 answers

GetVerifiedStatus from PayPal Adaptive Accounts Platform will do it for you.

There are no code samples or SDKs for Adaptive Accounts in Ruby in PayPal , but I found someone who wrote code for GetVerifiedStatus in Ruby .

The only change to this code that you would need to verify that it has an account is to change

if @xml['accountStatus']!=nil
    account_status = @xml['accountStatus'][0]
    #its pretty obvious from here init?
    if account_status.to_s() == "VERIFIED"
        render :text => "Account verified"
    else
        render :text => "Oopsy! Yet to be verified"
    end
else
    render :text => "Gee! sorry! something went seriously wrong"
end

to

if @xml['accountType']!=nil
    account_type = @xml['accountType'][0]
    #its pretty obvious from here init?
    if account_type.to_s() == "Business"
        render :text => "Business account!"
    elseif account_type.to_s() == "Premier"
        render :text => "Premier Account!"
    elseif account_type.to_s() == "Personal"
        render :text => "Personal account!"
    else
        render :text => "Account type not null but not a valid PayPal account type."
    end
else
    render :text => "Gee! sorry! something went seriously wrong"
end

: PayPal, , API, , 65-66, Adaptive .

+7

adaptiveaccounts-sdk-ruby gem. PayPal.

, , api.

:

require 'paypal-sdk-adaptiveaccounts'
@api = PayPal::SDK::AdaptiveAccounts::API.new( :device_ipaddress => "127.0.0.1" )

# Build request object
@get_verified_status = @api.build_get_verified_status({
  :emailAddress => "newEmailAddress@paypal.com",
  :matchCriteria => "NONE" })

# Make API call & get response
@get_verified_status_response = @api.get_verified_status(@get_verified_status)

# Access Response
if @get_verified_status_response.success?
  @get_verified_status_response.accountStatus
  @get_verified_status_response.countryCode
  @get_verified_status_response.userInfo
else
  @get_verified_status_response.error
end

PayPal

+4

All Articles