cancel
Showing results for 
Search instead for 
Did you mean: 

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

Highlighted
New Community Member

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

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!