2011-05-07 186 views
0

我想通知就像交易是成功還是失敗一樣。貝寶付款通知

我的代碼:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank"> 
<input type="hidden" name="cmd" value="_xclick"> 
<!--<input type="hidden" name="cmd" value="_s-xclick"> 
<input type="hidden" name="hosted_button_id" value="T4ETNVYF7D898"> 
--> 
<input type="hidden" name="business" value="[email protected]"> 
<input type="hidden" name="item_name" value="Ramakdu"> 
<input type="hidden" name="currency_code" value="USD"> 
<input type="hidden" name="amount" value="15.00"> 
<input type="hidden" name="return" value="http://localhost/paypal/"> 


<input type="image" src="https://www.sandbox.paypal.com/WEBSCR-640-20110429-1/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
<img alt="" border="0" src="https://www.sandbox.paypal.com/WEBSCR-640-20110429-1/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 

<?php 
    print_r($_REQUEST); 
?> 
+1

您的問題是什麼? IPN在[PayPal開發人員網絡](http://www.x.com)上有許多PHP示例,例如[這裏](https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation) – 2011-05-07 07:28:26

回答

1

試試這個:

<input type="hidden" name="return" value="http://example.com/paymentsuccess" /> 
    <input type="hidden" name="notify_url" value="http://example.com/paymentsuccess"> 
    <input type="hidden" name="cancel_return" value="http://example.com/paymentfailure" /> 

投資回報率應是一個鏈接,而不是 「本地主機」。

+1

謝謝....此行也可以正常工作....... http://localhost/paypal/sucess.php – Partyboy 2011-05-07 07:42:42

+0

很棒!請享用 !! – Rikesh 2011-05-07 08:15:12

0

請注意,「notify_url」必須是是可公開訪問的網址。退貨將用於測試,但notify_url是從PayPal方發起的POST,因此必須公開acc