php - 在 OmniPay 中获取 PayPal Rest 错误

标签 php paypal omnipay

我试图使用 Omnipay 在 PayPal Rest API 中强制出错,但是我得到的返回数据只是一个空数组。

基础知识:

$this->gateway = Omnipay::create($config['method']);

$this->gateway->setTestMode($config['testMode']);
$this->gateway->setClientID($config['clientID']);
$this->gateway->setSecret($config['secret']);

$response = $this->gateway
        ->purchase($this->purchaseData)
        ->setItems($items)
        ->send();

$reference = $response->getTransactionReference();

现在,当 clientIDsecret 正确时,我会得到一个引用。但是,当我错误地设置 API 详细信息并尝试使用 $response->getData() 记录响应时,我得到一个空数组。

$response->getMessage() 同样是空的。

我显然想知道这里出了什么问题,以及为什么付款未能为用户产生错误。

我是不是遗漏了什么,因为我所能找到的只是如何处理工作中的应用程序,我找不到任何错误。

PayPals 文档指出他们返回一个 HTTP 状态代码和一条消息,说明出了什么问题,我应该看到了,对吗?

最佳答案

嗯,听起来你遇到了一个错误。我可以要求您在 omnipay-paypal github 页面上的错误跟踪器中记录详细信息吗?我是 omnipay-paypal REST 网关的开发人员之一,所以我会尽快为您解决这个问题。记录错误详细信息后,请在此处或 github 上提醒我注意。

关于php - 在 OmniPay 中获取 PayPal Rest 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34153056/

相关文章:

php .htaccess url重写不正确的参数

php循环遍历json,不同的属性名

php - 在表单提交的同时操作中需要帮助

php - 使用 laravel 5 的 Omnipay、paypal REST

php - 使用 Paypal Express 的 Omnipay

PHP 循环行值

PHP,htaccess : Multiple script executing when use "RewriteBase/" on vhost

cocoa-touch - 验证 PayPal 移动支付 - 如何处理此验证

javascript - 带有重定向到下载链接的 javascript 按钮的 Paypal 集成

php - Omnipay 与 PayPal 快速结账