I am using PayumBundle (https://github.com/Payum/PayumBundle) with my symfony application (2.8.49).
I would like to test how my application interacts with payment error responses.
With Stripe gateway, it is not an issue since some card numbers will make the stripe API render an error response.
But With Paypal, I don't know how to do it ? I read the documentation of the Paypal Sandbox API (https://developer.paypal.com/docs/api/test-values/#) and this is what they say :
To trigger the SENDER_EMAIL_UNCONFIRMED simulation response, set the items[0]/note value to ERRPYO002 in the POST v1/payments/payouts call.
curl -X POST https://api.sandbox.paypal.com/v1/payments/payouts \
-H "content-type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
"sender_batch_header": {
"sender_batch_id": "1524086406556",
"email_subject": "This email is related to simulation"
},
"items": [
{
"recipient_type": "EMAIL",
"receiver": "[email protected]",
"note": "ERRPYO002",
"sender_item_id": "15240864065560",
"amount": {
"currency": "USD",
"value": "1.00"
}
}]
}'
How can we test errors with Paypal using Payum Bundle?
Thank you in advance
What you should evaluate are the response and the status code. To generate the requests you could use Guzzle that simplifies all.
Regards!