简体   繁体   English

Paypal中的payment_status

[英]payment_status in Paypal

I am using Website Payments Standard integration and in PDT I am confused about showing message to customer on return page if transaction fails due to something, but I cant get messages directly as a response from Paypal , rather I get codes. 我正在使用Website Payments Standard集成,并且在PDT如果因某种原因交易失败,我很困惑在return页面上向客户显示消息,但是我无法直接从Paypal获得消息作为响应,而是得到代码。 I was thinking to create a function that will take code as a Parameter and return Error Message. 我正在考虑创建一个将代码作为参数并返回错误消息的函数。 I went here and read about payment_status variable. 我在这里阅读了关于payment_status变量的信息。 I got confused when I saw same variable can can set to 1 value off 11 at one place and off 3 at another. 当我看到一个变量可以在一个位置从11处设置为1值而在另一个位置从3处设置为1时,我感到困惑。 What exactly it will return in my scenario? 在我的情况下它将返回什么? 1 off 3 or 1 off 11? 1折3或1折11?

Edit See that variable under Mass Pay Variables and Payment Information Variables in this link . 编辑请参阅此链接中“ Mass Pay Variables和“ Payment Information Variables的该Payment Information Variables

The payment_status would be various things depending on the txn_type. 根据txn_type,payment_status可能是各种各样的事情。 That's why they are separated in categories like that. 这就是为什么它们被分成这样的类别。 If you get a txn_type of masspay, then the payment_status would only be 1 of those 3. The majority of the txn_type's will have a payment_status that falls in the list of 11 you mentioned. 如果您获得了txn_type的masspay,则payment_status只能是这3个中的1个。大多数txn_type的pay_status都属于您提到的11个列表。 If you're using a standard button you'll typically follow the information under the Payment Information Variables section. 如果您使用的是标准按钮,通常会按照“付款信息变量”部分下的信息进行操作。

On another note, make sure you're not using PDT to handle any post-payment processing like updating your database, sending email notifications, etc. Even with Auto-Return enabled there is no guarantee the user will make it back to your return URL, and if they don't, that code will never run. 另一方面,请确保您没有使用PDT来处理任何后付款处理,例如更新数据库,发送电子邮件通知等。即使启用了自动返回功能,也无法保证用户会将其返回到您的返回网址,否则,该代码将永远无法运行。

Instead, you should use IPN to handle such processing, which is very similar to PDT except that it happens separate from the checkout flow altogether. 取而代之的是,您应该使用IPN来处理此类处理,该处理与PDT非常相似,只是它与结帐流程完全分开。 As soon as any transaction takes place on your account PayPal's server will POST data about that transaction to your IPN listener URL. 一旦在您的帐户上发生任何交易,贝宝的服务器就会将有关该交易的数据发布到您的IPN侦听器URL。 The data will be the same as what you're looking at with PDT, but IPN will always be triggered regardless of whether or not the user makes it back to your site. 数据将与您使用PDT查看的数据相同,但是无论用户是否将其返回到您的站点,都会始终触发IPN。

IPN will also allow you to correctly handle things like pending payments from e-checks, fraud filters, etc. that would need to clear before you deliver the product. IPN还可以让您正确处理诸如电子支票的待付款项,欺诈过滤器等,这些在交付产品之前需要清除。 You'll get an IPN when the pending payment takes place, and another IPN when that payment is updated to completed, failed, or whatever. 当待付款项发生时,您将获得一个IPN;当付款更新为完成,失败或其他时,您将获得另一个IPN。

IPN also allows you to automate tasks based on refunds, disputes, etc. It's a very powerful tool, and again, it's definitely recommended over PDT. IPN还允许您根据退款,纠纷等自动执行任务。这是一个非常强大的工具,因此,绝对推荐您在PDT上使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM