Reputation:
Hi I have following code for paypal payment.Here I am redirecting it to paypal sandbox for testing. I have following doubts in that
1) How it will recognize payments mean If any user pays, how it will transfer the money to particular account(Merchant)
2) In the paypal site, after paying amount,user will have option return to site, if he clicks on that he will redirects to my site http://Myrurl/Payments.aspx?cc=success. Based on the query string I will update his payment in my DB.
The problem is after user pay the safe, if he does not click on return to site, then his payments will not be updated in my DB.
Please give me any solution or how to implement paypal code.
<div style="display: block;" align="center">
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="[email protected]" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="" />
<input type="hidden" name="item_number" value="" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="services" />
<input type="hidden" name="notify_url" value=" " />
<input type="hidden" name="return" value="http://localhost:17743/payments.aspx?cc=success" />
<input type="hidden" name="cancel_return" value="http://localhost:17743/payments.aspx?cc=cancel" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest" />
<input name="imgCreditcard" style="text-align: center;" type="image" src="images/pay.jpg"
border="0" alt="PayPal - The safer, easierway to pay online!" /><!-- paypal1 ~/images/paypal1.jpg-->
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
height="1" />
<div id="divBack" runat="server" style="margin-left: -625px;" onclick="document.location.href=('../Home.aspx')">
</div>
</form>
</div>
Upvotes: 0
Views: 246
Reputation: 477
PayPal has a IPN callback option. This is a callback url that you can setup in your paypal settings. It could be something like this:
This url, once setup, will be called by paypal on payment events. The POST variables on that page will contain different values that will tell you how the payment did go. And you can also send a post back to verify that this call was legit and not made by some one else to fraud.
See the paypal ipn details on this page: https://www.paypal.com/ipn
Upvotes: 1