-
Notifications
You must be signed in to change notification settings - Fork 30
Description
I have several cases where, when generating payments using a Preapproval, the IPN response will get a 400 Bad Request response, as seen in the IPN History of my PayPal account.
I was able to trace this down to https://github.com/FundedByMe/django-paypal-adaptive/blob/master/paypaladaptive/api/ipn/endpoints.py#L84
The reason being, PayPal is acting inconsistent from their documentation (surprise!). An example of a response they are sending looks like the following (censored for identifying details):
payment_request_date=Wed Jan 08 23:30:05 PST 2014&return_url=http://scottsmarketplace.com/paypal/adaptive/pay/return/14/xxxxxxxxxxxxxxxxxxxx/&fees_payer=EACHRECEIVER&ipn_notification_url=http://scottsmarketplace.com/paypal/adaptive/ipn/14/xxxxxxxxxxxxxxxxxxxx/&sender_email=xxxxxxxxxxxxxx@yahoo.com&verify_sign=xxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxx&transaction[0].id_for_sender_txn=xxxxxxxxxxxxxxxxxxxx&transaction[0].receiver=xxxxx@scottsmarketplace.com&cancel_url=http://scottsmarketplace.com/paypal/adaptive/pay/cancel/14/xxxxxxxxxxxxxxxxxxxx/&transaction[0].is_primary_receiver=false&reason_code=CLEARED&pay_key=AP-xxxxxxxxxxxxxxxxxxxx&action_type=PAY&transaction[0].id=xxxxxxxxxxxxxxxxxxxx&transaction[0].status=Completed&transaction[0].paymentType=SERVICE&preapproval_key=PA-xxxxxxxxxxxxxxxxxxxx&transaction[0].status_for_sender_txn=Completed&transaction[0].pending_reason=NONE&transaction[0].amount=USD 9.99&status=COMPLETED&log_default_shipping_address_in_transaction=false&charset=windows-1252¬ify_version=UNVERSIONED&reverse_all_parallel_payments_on_error=false
Lots of censoring, obviously, but if you look carefully you will see that there is no transaction_type provided. They only sent back an action_type.
Has anybody else noticed this? My proposed solution so far would be defaulting the transaction_type to "Adaptive Payment PAY" but I haven't yet found any documentation to support that decision.
Is this a change which would be open to a pull request?