Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal IPN response not getting a payKey or trackingId?

I'm trying to get the whole PayPal AdaptivePayments#Pay working, that part works. I pass a bunch of stuff in, get a paykey, which I pass to the approval url:

{returnUrl: urls[:return],
 cancelUrl: urls[:cancel],
 requestEnvelope: {errorLanguage: "en_GB"},
 currencyCode: "GBP",
 trackingId: self.id,
 receiverList: {
   receiver: [{email: Rails.configuration.site_paypal, amount: self.amount, primary: true},
              {email: self.provider.paypal_email, amount: self.amount, primary: false}]
 },
 actionType: "PAY",
 ipnNotificationUrl: urls[:ipn]}

The server comes back with everything correctly, I redirect to the url, it works, I get the payment in my PayPal sandbox account for Rails.configuration.site_paypal and in the IPN history I see the message but I have no way to identify it as it doesn't contain a paykey or trackingId :(

transaction_subject=
txn_type=web_accept
payment_date=10:06:09 Aug 17, 2012 PDT
last_name=Baldry
residence_country=GB
item_name=
payment_gross=
mc_currency=GBP
business=<Rails.configuration.site_paypal>
payment_type=instant
protection_eligibility=Ineligible
verify_sign=Asu0z613h-fyw8CNuZEjSsMXS58PAi46SzR3IvXXTX5JUizhF8vV4z25
payer_status=verified
test_ipn=1
tax=0.00
payer_email=<[email protected]>
txn_id=9M582867K79935008
quantity=0
receiver_email=<Rails.configuration.site_paypal>
first_name=Michael
payer_id=M7U3UVA3E65VY
receiver_id=375R229JBE3TY
item_number=
payment_status=Completed
mc_gross=157.00
custom=
charset=windows-1252
notify_version=3.6
ipn_track_id=c9fcf587d770f

What am I doing wrong? Ripping my hair out...

Thanks

like image 329
Michael Baldry Avatar asked Aug 17 '12 17:08

Michael Baldry


1 Answers

There are two types of IPN's

One is generated for the account that receives the money, based on their profile settings (It looks like that is the one you are getting)

The other is generated for the API caller (who may or may not be financially involved in the transaction). The API caller's IPN will include the PayKey.

If the API caller, and one of the receivers are the same, Make sure that you can either differentiate between the two IPN's you will receive, or that you have separate URL's for each. (The API callers is specified when making the API call, the receiver's is specified on the PayPal profile)

like image 178
Lenny Markus Avatar answered Sep 30 '22 13:09

Lenny Markus