am i recapturing payments multiple times for the same order?

psykressx
Contributor
Contributor

im using node sdk api, and when create a payment it sends me to the redirect i specify in paypal.payment.create, everything is working fine, i then grab the get data out of the url and send to my back end then with that data i run paypal.payment.execute.
all working no problem, except if i refresh the redirect page the 
paypal.payment.execute runs again.. and successfully.. now... i need to know is they same order with same payment_id being payed for again?? or does the server just return the same data from the already executed payment.

i need know so i can either just stop the database from saving the same order information, or if a user can accidentally repay for the exact same order i have a much bigger problem.

if this is recapturing payment for the exact same order how are people dealing with this issue.

Login to Me Too
1 REPLY 1

psykressx
Contributor
Contributor

after a bit of testing and keeping a close eye on on the sandbox account i concluded i am not, so for any one wondering the same thing, just save the payment_id from the response json as your own order id then you can run a quick query before storing as to avoid repeated data.

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.