by thenduks · 12y ago · 0 comments
When my users are redirected back to my site (thanks page, or similar), I check if their transaction is completed, if not, I kick off an every-five-seconds check while asking the user to hold on while we talk with paypal. I will eventually fail after some number of checks of course, but this means PayPal can stop sending IPNs and everything will just keep going along just fine.
If the user might not end up back on your site for some reason, run a cronjob that tries to verify transactions created in the past day/hour/whatever.
An issue like this doesn't have to, and really shouldn't, cripple your business.
PaymentDetails is mandatory for any adaptive payments integration.
https://developer.paypal.com/docs/classic/api/adaptive-payme...
My favorite Paypal annoyance is that for split payments there's no way to verify that a seller's Paypal account qualifies for split payments (has to be a business account and verified), without trying to send a payment. At least, that's the way it was last it mattered to me.
Here's a snippet in Ruby I use to check. It's not perfect, but it catches a lot of cases:
# ...
def initialize
@request = PaypalAdaptive::Request.new
end
# ...
def verified_status( opts={} )
begin
opts.assert_keys! :first_name, :last_name, :paypal_account_email
result = @request.get_verified_status(
emailAddress: opts[:paypal_account_email],
firstName: opts[:first_name],
lastName: opts[:last_name],
matchCriteria: 'NAME'
)
Rails.logger.debug "PAYPAL VERIFICATION: #{result.inspect}"
return result.success? && result['accountStatus'] == 'VERIFIED'
rescue
return false
end
end
Here's the API docs: https://developer.paypal.com/docs/classic/api/adaptive-accou...What I can't stand is that accounts in some countries (at least India) can't send payments from balance. So you can't get your fee. This is mentioned nowhere in the docs, a customer just hit it one day and that's how I found out. I asked paypal what other countries can't send payments and they said... wait for it... they "don't have a list". I kid you not: https://twitter.com/rfunduk/status/412980259001102336