How to place an order with PayPal payment method as failed?

Anonymous_User
Not applicable

I've integrated the Paypal sandbox with Magento 2. I want a logic to happen when an order failed with Paypal payment. In order to test the logic, I want to make the payment fail.I'm using PayPal sandbox and tried to debug the response from the DoExpressCheckoutpayment inbuilt method in PayPal but couldn't get a clue and couldn't make the PayPal payment to fail. Any help would be appreciated.

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

You can enable negative testing, it is specific to testing certain error conditions in Sandbox.

Here is the documentation on it from the PayPal Developer Website:

https://developer.paypal.com/docs/api-basics/sandbox/error-conditions/

 

Thanks,

Jennifer

PayPal

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.