贝宝(PayPal):客户继续付款,点击付款并返回成功页面,但未付费 [英] PayPal: Client proceed to payment, clicked pay and got back to success page, but was not charged

查看:245
本文介绍了贝宝(PayPal):客户继续付款,点击付款并返回成功页面,但未付费的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用贝宝(Paypal)付款按钮,在某些情况下,用户单击该按钮,将其重定向到贝宝,登录,单击付款"按钮并重定向到成功页面,但是客户帐户没有被收费,而贝宝却没有通话通知网址.基本上没有交易.

I am using paypal pay button on my website, and in some cases user clicks it, redirected to the PayPal, signs in, clicks on pay button and redirected to the success page, but client account does not get charged and paypal does no call notify URL. Basically there were no transaction.

这是用户重定向到的URL:

Here is the URL that user is redirected to:

https://www.paypal.com/cgi-bin/webscr?processPayment=1
&cmd=_xclick
&currency_code=USD
&no_shipping=1
&cancel_return=https://www.domain.com/cancel.php
&return=https://www.domain.com/return.php
&notify_url=https://www.domain.com/notify_url.php
&business=payments@domain.com
&receiver_email=payments@domain.com
&item_number=1
&item_name=Application+Payment
&amount=16.00
&quantity=1
&src=1
&sra=1

在大多数情况下,它是具有以下标头的移动设备:Mozilla/5.0(Linux; Android 6.0; VS990 Build/MRA58K)AppleWebKit/537.36(KHTML,例如Gecko)Chrome/48.0.2564.95 Mobile Safari/537.36

In most cases it is Mobile device with following headers: Mozilla/5.0 (Linux; Android 6.0; VS990 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.95 Mobile Safari/537.36

Mozilla/5.0(Linux; Android 6.0.1; SM-G935V Build/MMB29M; wv)AppleWebKit/537.36(KHTML,like Gecko)Version/4.0 Chrome/50.0.2661.86 Mobile Safari/537.36 [FB_IAB/FB4A; FBAV /78.0.0.16.67;]

Mozilla/5.0 (Linux; Android 6.0.1; SM-G935V Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/78.0.0.16.67;]

一切正常一年,并且在2天前就开始发生,并且影响了大约10%的用户.

Everything worked fine for a year, and that started to happen 2 days ago, and effects about 10% of the users.

推荐答案

在成功页面上提供实际产品之前,您实际上需要仔细检查交易.

You actually need to double-check the transaction before offering the actual product on the success page.

您可以为此使用PDT: https://developer. paypal.com/docs/classic/products/payment-data-transfer/.它可以让网站在将数字商品和下载内容提供给客户之前,立即验证它们是否已全额支付.

You can use PDT for this: https://developer.paypal.com/docs/classic/products/payment-data-transfer/ . It allows the website to instantly verify that digital goods and downloads are actually fully paid for, before offering them to the customer.

因此,当用户到达您的成功页面时,您只需在同一页面中进行PDT调用并验证交易即可:

So when user reaches your success page, you simply make a PDT call within the same page and verify the transaction:

  • 如果付款成功,您就可以放心地给他们礼物
  • 如果付款失败,您会向他们显示错误,让他们知道付款实际上没有进行.

Paypal实际上建议同时使用IPN和PDT以获得最佳效果,因为它们具有不同的目的并实现相同的目标.在这里阅读: https://developer.paypal.com/docs/classic /ipn/integration-guide/IPNPDTAnAlternativetoIPN/.底部显示如果必须立即通知您的网站付款,则可以同时实施IPN和PDT."

Paypal actually suggests that both IPN and PDT should be used for best results, as they have different purposes and complete the same goal. Read here: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNPDTAnAlternativetoIPN/ . At the bottom, it says "If your site must be notified of payments immediately, you can implement both IPN and PDT."

您的情况并不新鲜.我过去曾听说过类似的案例.原因可能会有所不同,只有Paypal才能给出实际原因的答案.

Your situation is not new. I've heard of similar cases in the past. Reasons might vary, and only Paypal could give the answer for the actual reason.

也:如果您不想更改成功页面,请在调用PDT时使用中间重定向器页面来验证其请稍候,验证您的交易...".如果PDT返回成功,则将它们重定向到最终的成功页面.如果没有,请向他们显示错误.

Also: If you don't want to change your success page, use an intermediate redirector page that verifies it "please wait, verifying your transaction..." while making the PDT call. If PDT returns success, then redirect them to the final success page. If not, show them the error.

这篇关于贝宝(PayPal):客户继续付款,点击付款并返回成功页面,但未付费的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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