DanielAttard
asked on
Complete javascript after call to PayPal
What is the best way to implement a call to PayPal so that after a customer completes the payment process, they are then directed back to the original site where the rest of the javascript can continue?
Perhaps I am not even thinking of this problem in the right terms Basically I want some javascript code to run, but only after a successful PayPal payment has been completed.
Here is the code for the call to PayPal:
Any ideas or best practices for me to consider? Thanks.
Perhaps I am not even thinking of this problem in the right terms Basically I want some javascript code to run, but only after a successful PayPal payment has been completed.
Here is the code for the call to PayPal:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="123456789">
<input type="image"
src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.gif"
border="0" name="submit"
alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1"
height="1">
</form>
Any ideas or best practices for me to consider? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great points angelleye. I hadn't thought about the possibility of the user not making it to the return URL. In my particular use-case, I absolutely need my javascript code to run at the moment the payment is processed on PayPal. I will start reading-up on IPN.
Thanks.
Thanks.
You can use the same url/page and add a parameter in the url
or use a different page