简体   繁体   中英

Paypal payment works on sandbox but not live paypal?

We are facing some issue with paypal business account, under sandbox everything is working fine, bellow is the form we are using for live:

<form method="post" action="https://www.paypal.com/cgi-bin/webscr" id="paypalForm"> 
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" value="email@email.com" name="business">
<input type="hidden" value="1" name="quantity">
<input type="hidden" value="website" name="item_name">
<input type="hidden" value="MDAW" name="item_number">
<input type="hidden" value="0.3" name="amount">
<input type="hidden" value="0" name="shipping">                                
<input type="hidden" value="http://www.website.com/ipn.php" name="notify_url">
<input type="hidden" value="USD" name="currency_code">                                
<input type="hidden" value="http://website.com/orderconfirm.php" name="return">
<input type="hidden" value="12" name="custom">                                                                     <a class="btn btn-primary" href="selectpixel.php"><i class="fa fa-angle-double-left"></i> Back</a>
<button id="btnOrderForm" class="btn btn-success" type="button">Make     Payment via PayPal</button>
</form>

Bellow is the IPN URL where we are receiving custom values correctly while go through sandbox: http://www.website.com/ipn.php

But we're not sure what is happening with live paypal, we are not able to go back to our site and not even receive custom variable on ipn.php file even after successful transaction.

IPN url is same as sandbox and other then that everything is same.

When the user clicks a 'pay now' button, that will redirect you on paypal and then from payal after payment it messed in case of live paypal transaction, the user can pay successfully but it is not returing back to website and IPN is not hit back to http://website.com/ipn.php url for updating information.

Firstly, your link ( http://www.website.com/ipn.php ) showing "HTTP 404 - File not found" when access. So, you are quested to modify this page to the available one. You can go to the link ( https://github.com/paypal/ipn-code-samples ) for PayPal's latest IPN sample code, and then update accordingly to your IPN script page.

Secondly, you can refer to the link ( https://developer.paypal.com/docs/classic/button-manager/integration-guide/ButtonManagerHTMLVariables/?mark=html ) for the HTML variable for PayPal button. The variable "return" is for the function to redirect your customers to a page after they finish the payment. The variable "notify_url" is designed for PayPal IPN which is for the function to notify the back end of your web server about the transaction information. You can go to the link below for the detais about PayPal IPN ( https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/ )

 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="email@email.com"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="Test_Item"> <input type="hidden" name="item_number" value="MDAW"> <input type="hidden" name="amount" value="0.3"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="quantity" value="1"> <input type="hidden" name="return" value="http://website.com/orderconfirm.php"> <input type="hidden" name="notify_url" value="http://website.com/orderconfirm.php"> <input type="hidden" name="button_subtype" value="products"> <input type="hidden" name="cn" value="Add special instructions to the seller"> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="weight_unit" value="lbs"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"> <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_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/en_US/i/scr/pixel.gif" width="1" height="1"> </form> 

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