cancel
Showing results for 
Search instead for 
Did you mean: 

Reset (un)captured order - Smart Button (Re-posting in correct board)

Highlighted
New Community Member

Reset (un)captured order - Smart Button (Re-posting in correct board)

Hi everyone,

I am implementing a smart button and I am showing a modal confirmation before I capture the order. The modal has 2 buttons, "Cancel" and "Confirm". When the user clicks "Confirm" button, that is the time I capture the order and when the user clicks "Cancel", the modal will close and no capture will happen. The issue is the captured order gets doubled when the user canceled the transaction and click the PayPal button again and confirm the transaction this time. Is there a way to reset or destroy the created order when the user clicks the "Cancel" button?

 

Attached is the sample code block

Annotation 2019-07-09 191502.jpg