Paypal 结账退货数据 [英] Paypal checkout return data

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

问题描述

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

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 返回一些数据吗?例如交易结果?或者,如果用户被重定向到返回 url,我应该假设付款处理成功?

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.

推荐答案

https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI0709B

你必须在你的表单上启用 rm 选项,而你想使用返回 url

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

  • return(Optional) 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/en_US/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.如果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.

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

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