贝宝沙箱返回网址 [英] Paypal sandbox return url

查看:94
本文介绍了贝宝沙箱返回网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在沙盒上测试一个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

解决方案

添加"rm"参数并将其设置为"2".这将导致POST包含所有事务变量的成功页面. 在此处了解详情.. >

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

解决方案

Add the "rm" parameter and set it to "2". This causes a POST to the success page, with all transaction variables. Read more here.

这篇关于贝宝沙箱返回网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆