问题
I'm testing a Paypal subscribe button at the sandbox and basically I'm receiving an encrypted variable named auth when finishing the purchase and hitting the return url. Is there something wrong in the code or is just the way it should work when using the Paypal sandbox? Haven't tried with the IPN part because apparently since I'm using a local machine to test the IPN simulator does not give any results. Please help!
<?
//paypal url for standard form submission via post... no API
$environment = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$cancel_url='http://192.168.100.136/ProjectX/protos/jquery-menu2/';
$return_url='http://www.interorg.com';
$notify_url='http://192.168.100.136/ProjectX/protos/jquery-menu2/includes/ipn2.php';
?>
<form name='subscribe' action="<?=$environment?>" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="jeanpa_1350092589_biz@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Subscription to InterOrg - Membership Plan: Silver">
<input type="hidden" name="item_number" value="1nT3r0rG">
<input type="hidden" name="src" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="usr_manage" value="1">
<input type="hidden" name="return" value="<?=$return_url?>">
<input type="hidden" name="cancel_return" value="<?=$cancel_url?>">
<input type="hidden" name="notify_url" value="<?=$notify_url?>">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest">
<table>
<tr><td><input type="hidden" name="on0" value=""></td></tr><tr><td>
<select name="os0">
<option value="Monthly1">Silver : $10.00 USD - monthly</option>
<option value="Monthly2">Golden : $20.00 USD - monthly</option>
</select> </td><td>
<!--<button type="submit" value="Subscribe" style="font-Weight:bolder; padding-left:6px; padding-right:6px; padding:3px" name="submit" alt="PayPal">Subscribe</button>-->
<input type="submit" value='Subscribe' style='font-Weight:bolder'>
</td></tr>
</table>
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Monthly1">
<input type="hidden" name="option_amount0" value="10.00">
<input type="hidden" name="option_period0" value="M1">
<input type="hidden" name="option_frequency0" value="1">
<input type="hidden" name="option_select1" value="Monthly2">
<input type="hidden" name="option_amount1" value="20.00">
<input type="hidden" name="option_period1" value="M2">
<input type="hidden" name="option_frequency1" value="1">
<input type="hidden" name="option_index" value="0">
<input type="hidden" name="src" value="1">
<input type="hidden" name="amount" value="10.00">
<!-- original code from the paypal standard button generator
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_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>
Whenever I test this form in the sandbox, I get a variable like the following:
?auth=ACApkCA2r7JK2eRIY-KBHrr6UylVMQouy4DDWvWwpthFjWfxxlT.oe2zSaP5RPRGiMi-ZEutGj.9NH.KvsWoXfA&form_charset=UTF-8
回答1:
Add the "rm" parameter and set it to "2". This causes a POST to the success page, with all transaction variables. Read more here.
来源:https://stackoverflow.com/questions/13038080/paypal-sandbox-return-url