2012-08-17 573 views
0

我正在嘗試將支付網關集成到基於PHP的應用程序中。爲此,我正在使用沙箱。 但付款後,狀態顯示爲待處理,但金額已從帳戶中扣除。Paypal在付款後顯示狀態'Pending'

我的代碼是這樣的:

<form name="frm" 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="amount" value="<?php echo get_plan_value($plan_id); ?>" /> 
    <input type="hidden" name="no_shipping" value="1" /> 
    <input type="hidden" name="no_note" value="1" /> 
    <input type="hidden" name="currency_code" value="USD" /> 
    <input type="hidden" name="lc" value="US" /> 
    <input type="hidden" name="item_name" value="<?php echo get_plan_name_by_value($_REQUEST['bus_plan']) ?> Registration" /> 
    <input type="hidden" name="bn" value="PP-BuyNowBF" /> 
    <input type="hidden" name="return" value="http://localhost/uploaded_server_alert/backup/alertR/business/payments-over.php?last_id=<?php echo $lastId; ?>&agent_email=<?php echo $agent_email; ?>&username=<?php echo ($uname); ?>&contact_email=<?php echo $contact_email; ?>" /> 
    <input type="hidden" name="rm" value="2" /> 

    <input type="submit" border="0" name="submit" value="Order Now" alt="Make payments with PayPal - it's fast, free and secure!" class="additional_height" title="Make payments with PayPal - it's fast, free and secure!" /> 
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> 
    </form> 

我應如何解決這一問題?

+0

你給了localhost url的返回值? – 2012-08-17 07:46:36

+0

雅我已經給出了像&agent_email = <?php echo $ agent_email;?>&username = <?php echo($ uname);?>&contact_email = <?php echo $ contact_email;?>「/> – Bappa 2012-08-17 07:47:46

+0

notify_url輸入標記丟失。 – 2012-08-17 08:19:22

回答

2

這是因爲Payment Review已啓用。

其更改爲殘疾人開發中心 - >測試帳戶

+0

非常感謝您的幫助... – Bappa 2012-08-17 08:31:57

0

問題是,你沒有提到的notify_url。 notify_url是PayPal發送IPN用於驗證物品價格,reciever_email,貨幣等的地址,notify_url不應該是localhost的url,因爲當您重定向到paypal時,您現在位於paypal的域中,並且在完成交易後,paypal嘗試發送IPN命中它將得到本地主機的`ulr,並且在paypal上沒有像localhost一樣的東西。

Write following input tag: 

<input type="hidden" id="notify_url" name="notify_url" value="url of ipn listener"/> 

in above tag replace value by your ipn listener url.