贝宝结帐返回数据 [英] Paypal checkout return data

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

问题描述

我有一个贝宝按钮,如下所示:

I have a paypal button as follows:

<form id="fmPaypal" method="post" action= "https://www.sandbox.paypal.com/cgi-bin/webscr">
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="currency_code" value="NZD">
        <input type="hidden" name="business" value="blah01@yahoo.com">
        <input type="hidden" name="item_name" value="Order">
        <input type="hidden" id="item_number" name="item_number" value="123">
        <input type="hidden" name="amount" value="0.01">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="return" value="http://www.blah.com/checkout/return.cfm" />
        <input type="hidden" name="cancel_return" value="http://www.blah.com/checkout/cancel" />
</form>

这有效,并且用户被重定向到准备付款的贝宝.

This works and users are redirected to paypal ready for payment.

但是,我是否应该期望通过返回URL从Paypal返回一些数据?例如交易结果?还是如果用户重定向到返回网址,我是否应该假设付款已成功处理?

But, should I expect to get some data returned from paypal via the return URL? e.g. results of the transaction? Or should I assume that the payment processed successfully if the user is redirected to the return url?

试图从文档中获取此信息没有成功.

Tried getting this information from the docs without success.

推荐答案

要使用返回网址,必须在表单上启用rm选项

You have to enable the rm option on your form while you want to use return url

  • return(可选)贝宝(PayPal)将买家浏览器重定向到的URL 他们完成付款后.例如,在您的网址上指定一个网址 显示谢谢您付款"页面的网站.默认 - 贝宝将浏览器重定向到贝宝网页. 1,024

  • return(Optional) The URL to which PayPal redirects buyers' browser after they complete their payments. For example, specify a URL on your site that displays a "Thank you for your payment" page. Default – PayPal redirects the browser to a PayPal webpage. 1,024

rm :(可选)返回方法.用于将数据发送到 返回变量指定的URL.允许的值为:

rm: (Optional) Return method. The FORM METHOD used to send data to the URL specified by the return variable. Allowable values are:

0 –所有购物车付款都使用GET方法

0 – all shopping cart payments use the GET method

1 –买方的 使用GET方法将浏览器重定向到返回URL,但是 不包括付款变量

1 – the buyer's browser is redirected to the return URL by using the GET method, but no payment variables are included

2 –买方的浏览器是 使用POST方法重定向到返回URL,并进行所有付款 包含变量,默认为0.

2 – the buyer's browser is redirected to the return URL by using the POST method, and all payment variables are included The default is 0.

注意:rm变量仅在设置了返回变量时才生效.

Note: The rm variable takes effect only if the return variable is set.

这是IPN返回的参考文件

Here is reference document what IPN return

https://developer.paypal.com/webapps/developer /docs/classic/ipn/gs_IPN/

然后我在这里引用它以方便查看

Then I quoted it here for convenient review

$ item_name = $ _POST ['item_name'];
$ item_number = $ _POST ['item_number'];
$ payment_status = $ _POST ['payment_status'];
$ payment_amount = $ _POST ['mc_gross'];
$ payment_currency = $ _POST ['mc_currency'];
$ txn_id = $ _POST ['txn_id'];
$ receiver_email = $ _POST ['receiver_email'];
$ payer_email = $ _POST ['payer_email'];

$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];

您应该已经有此文档PDF,但是我想我也应该将其放在此处 https://www.paypalobjects.com/webstatic/zh_CN/developer /docs/pdf/ipnguide.pdf

you should have this document PDF already, but I think I should put it here also https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf

我必须提醒您重要的事情,您必须在帐户中启用自动退货"

Of cause I have to remind about the important thing, you have to enable "Auto Return" on your account

默认情况下,自动返回"处于关闭状态.要打开自动返回,请执行以下操作:

Auto Return is turned off by default. To turn on Auto Return:

通过 https://www.paypal.com 登录到您的PayPal帐户.我的 出现帐户概述"页面.单击配置文件子选项卡.个人资料 出现摘要"页面.点击左侧的我的销售工具"链接 柱子.在网上销售部分下,点击 网站偏好设置"行.网站付款首选项页面 出现在网站付款的自动退还"下,单击广播" 按钮启用自动返回.在返回URL"字段中,输入URL 您希望付款人在完成付款后将其重定向到 付款.注意:贝宝会检查您输入的返回URL.如果 网址格式不正确或无法验证,PayPal不会 激活自动返回.滚动到页面底部,然后单击 保存按钮.

Log in to your PayPal account at https://www.paypal.com. The My Account Overview page appears. Click the Profile subtab. The Profile Summary page appears. Click the My Selling Tools link in the left column. Under the Selling Online section, click the Update link in the row for Website Preferences. The Website Payment Preferences page appears Under Auto Return for Website Payments, click the On radio button to enable Auto Return. In the Return URL field, enter the URL to which you want your payers redirected after they complete their payments. NOTE: PayPal checks the Return URL that you enter. If the URL is not properly formatted or cannot be validated, PayPal will not activate Auto Return. Scroll to the bottom of the page, and click the Save button.

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

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