Hello @zylvie ,
Thank you for posting to the PayPal Sandbox Community.
I tested in Postman, putting all the values in the header and was able to get the correct response.
Here is what I passed in:
Post to this endpoint (with any order id you can even use this one 5O190127TN364715T)
https://api.sandbox.paypal.com/v2/checkout/orders/{{order_id}}/capture
Here are the header Key and Values:
Content-Type Value: application/json
Authorization Value: Bearer{{access_token}}
PayPal-Mock-Response Value: {"mock_application_codes": "INSTRUMENT_DECLINED"}
Here is the response:
Response:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"issue": "INSTRUMENT_DECLINED",
"description": "The instrument presented was either declined by the processor or bank, or it can't be used for this payment."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-INSTRUMENT_DECLINED",
"rel": "information_link",
"method": "GET"
}
]
}
As long as you have an order id being passed into the endpoint you should get the valid Instrument Decline error.
Thank you,
Jennifer
MTS
PayPal
... View more