How can I trigger capture() error after onAprrove to test ?

donguyencong
New Community Member

Hi guys, I saw on the demo: 

 

// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}

 

How can I force actions.order.capture() to return an error instead of success?

Thank you very much!

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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