1

我正在沙箱中测试一个 Paypal 订阅按钮,基本上我在完成购买并点击返回 url 时收到一个名为 auth 的加密变量。代码中是否有问题,或者只是使用 Paypal 沙箱时应该工作的方式?没有尝试过 IPN 部分,因为显然因为我使用本地机器来测试 IPN 模拟器并没有给出任何结果。请帮忙!

                <?
                //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> 

每当我在沙箱中测试此表单时,我都会得到一个如下所示的变量:

   ?auth=ACApkCA2r7JK2eRIY-KBHrr6UylVMQouy4DDWvWwpthFjWfxxlT.oe2zSaP5RPRGiMi-ZEutGj.9NH.KvsWoXfA&form_charset=UTF-8
4

1 回答 1

3

添加“rm”参数并将其设置为“2”。这会导致一个 POST 到成功页面,其中包含所有事务变量。在这里阅读更多

于 2013-01-03T13:05:08.703 回答