【问题标题】:Omnipay - Empty Error MessageOmnipay - 空错误消息
【发布时间】:2018-08-07 09:24:58
【问题描述】:

我一直在使用这段代码,但仍然无法弄清楚它有什么问题。

也许某些代码有问题,但 Omnipay 没有显示任何错误消息。

谁能帮我找出我的错误?

    $gateway = Omnipay::create('Eway_RapidDirect');
    write_log($gateway->getDefaultParameters());
    $gateway->initialize([
        'apiKey' => 'API KEY',
        'password' => 'PASSWORD',
        'testMode' => true
    ]);

   $card = new CreditCard([
      'number' => '4444333322221111',
      'expiryMonth' => '6',
      'expiryYear' => '2030',
      'cvn' => '123'
     ]
   );

   $transaction = $gateway->purchase([
       'amount'        => '10.00',
       'currency'      => 'AUD',
       'transactionId' => 'RAM0001',
       'card'          => $card,
     ]
   );

   $response = $transaction->send();
   if ($response->isSuccessful()) {
       write_log('success');
   } else {
       write_log('failed');
       write_log($response->getMessage());
   }

代码总是打印出来

[07-Aug-2018 09:07:01 UTC] failed
[07-Aug-2018 09:07:01 UTC]

插件github:Omnipay Eway

【问题讨论】:

    标签: php payment-gateway omnipay eway


    【解决方案1】:

    此问题是由于 OmniPay eWAY 库中未设置身份验证标头的错误造成的。更糟糕的是,身份验证失败没有得到妥善处理,导致出现空白错误消息。

    Version 3.0.1 包含对缺少身份验证的修复。

    【讨论】:

      猜你喜欢
      • 2016-03-13
      • 2015-11-21
      • 2022-01-13
      • 2016-03-03
      • 2014-12-07
      • 2018-01-01
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多