简体   繁体   中英

Paypal Business Standard: How to handle action after the payment?

I want to use Paypal Payment Standard(the one jumps to paypal to pay and jumps back after payment is done) to handle the payment on my site.

I know I can add a callback url to the button, but I could not figure out the right logic.

I want to store user payment status(true or false) and date into database after they finish checking out and jumping back to my site.

What is the best approach for this? I am thinking some kind of token. I don't know if I am on the right track.

By the way, I use Servlet and JSP in my site.

Thanks in advance

I use this payment method on a couple of sites, it is super easy to integrate. On form submission I set a token and call that token back on the confirmation page. I use a receipt page to display the order and then submit it to paypal using a hidden form.

<input type="hidden" name="return" value="http://www.mysite.com/returnurl.html">
<input type="hidden" name="cancel_return" value="http://www.mysite.com/cancelurl.html"> 

You can find all the documentation you need here.

https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_formbasics

After a person has paid successfully I call the token into hidden form fields, apply the values add an animated loading image a little javascript

<script type="text/javascript" language="javascript">
setTimeout("document.forms['form1'].submit();",2*1000);

data goes to the database and then straight to the thank you success thanks for paying page. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM