We are using the python package for Paypal.
The sandbox key is working fine, but when we switch to the live key, only the payout feature stops working:
Error message:
{"name":"AUTHORIZATION_ERROR","message":"Authorization error occurred","debug_id":"87fe36dc5d7a7","information_link":""}
I'm assuming it is because this feature is disabled on live accounts and we can request it, we need this feature for our site to work.
heres the code we're using:
payout = Payout({
"sender_batch_header": {
"sender_batch_id": sender_batch_id,
"email_subject": "Payment Sent"
},
"items": [
{
"recipient_type": "EMAIL",
"amount": {
"value": '{:.2f}'.format(payout),
"currency": "GBP"
},
"receiver": payee_paypal,
# "note": "Thank you.",
},
]
})
if payout.create():
payout_sent.send(promise, payment_id=payout.batch_header.payout_batch_id)
else:
payment_error.send(promise, reason=payout.error)
You need to have Mass Payments enabled on your PayPal account. Easiest way to check to see if you do indeed do have Mass Payments enabled is to visit 'my account' area at https://developer.paypal.com/webapps/developer/applications/myapps
If you do have a green check next to Payouts, then you are enabled. For both RESTful Payouts and Mass Payments. If you do not, then click through the Enable link. You kick off an application if you have a US PayPal account. If not, you'll have to contact your local Customer Support team.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With