PayumBundle icon indicating copy to clipboard operation
PayumBundle copied to clipboard

Is there a way to test negative responses ?

Open NadjibBELLOUNDJA opened this issue 5 years ago • 0 comments

I would like to test how my application interacts with 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

NadjibBELLOUNDJA avatar Apr 16 '19 18:04 NadjibBELLOUNDJA