Verify an email address is a paypal user

paypal, ruby, ruby-on-rails

Solution

GetVerifiedStatus from PayPal's Adaptive Accounts platform will do this for you.

PayPal does not have any code samples or SDKs for Adaptive Accounts in Ruby, but I did find someone who has written the code for GetVerifiedStatus in Ruby.

The only change to that code you would need to have it check what type of account they have 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

Note: PayPal apparently has not updated their API reference page, so use the information contained on pages 65-66 in the Adaptive Accounts guide for now.

Problem

I want to verify that an email address is a PayPal user. Is there an API call to do that? Is there a ruby lib that does this ? Thanks

Original source