如何使用omnipay检查是否为待付款 [英] How do I use omnipay to check if it's a pending payment or not

查看:334
本文介绍了如何使用omnipay检查是否为待付款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Omnipay 2.1和CodeIgniter 2.1.4接收Paypal付款。



我使用此行完成购买并检查付款是否已发送:

  $ bool = $ gateway-> completePurchase(array('amount'=> $ total,'currency'=> ;'EUR'))
- > send()
- > isSuccessful();但是我注意到方法 isSuccessful()

>



如何使用omnipay检查是否为付款方式?如果付款处于待处理状态,还会返回 true

解决方案

查看原始回应资料,重要的线是:

  [ACK] =>成功
[PAYMENTINFO_0_CURRENCYCODE] => EUR
[PAYMENTINFO_0_PAYMENTSTATUS] =>待处理
[PAYMENTINFO_0_PENDINGREASON] => multivrency

因此付款已成功处理,但处于 code> state。 Omnipay没有明确检查这一点,但我不知道这将是明智的。从客户的角度来看,付款已成功,并且款项已离开其帐户。



查看 PayPal API文档 PAYMENTINFO_0_PENDINGREASON


多币种 - 您没有所发送货币的余额,并且您的付款接收首选项设置为自动转换并接受此付款。您必须手动接受或拒绝此付款。


基本上付款已成功,唯一的原因是您正在收费客户以您在PayPal帐户中未明确启用的货币(EUR)。


I'm using Omnipay 2.1 and CodeIgniter 2.1.4 to receive Paypal payments.

I use this line to complete the purchase and check if the payment was sent:

$bool = $gateway->completePurchase(array('amount' => $total, 'currency' => 'EUR'))
                ->send()
                ->isSuccessful();

But I noticed that the method isSuccessful() will also return true if the payment is on pending.

How can I use omnipay to check if it's a pending payment or not?

解决方案

Looking at your raw response data, the important lines are:

[ACK] => Success
[PAYMENTINFO_0_CURRENCYCODE] => EUR
[PAYMENTINFO_0_PAYMENTSTATUS] => Pending
[PAYMENTINFO_0_PENDINGREASON] => multicurrency

So the payment was processed successfully, but is in a Pending state. Omnipay doesn't explicitly check for this, but I'm not sure that would be sensible anyway. From the customer's point of view, the payment was successful, and money has left their account.

Looking at the PayPal API documentation for PAYMENTINFO_0_PENDINGREASON:

multi-currency – You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.

So basically the payment was successful, the only reason it is pending is that you are charging customers in a currency (EUR) that you haven't explicitly enabled in your PayPal account.

这篇关于如何使用omnipay检查是否为待付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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