本文介绍了如何在PHP中集成eWay支付系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照文档站点 https://eway.io/api-v3/的要求将Payment系统集成到了我的PHP应用程序中.然后从应用程序的终端运行命令 composer require eway/eway-rapid-php .之后,我加载 autoload.php .

I have followed the document site https://eway.io/api-v3/ to integrate the Payment system into my PHP application. And I run the command composer require eway/eway-rapid-php from terminal in the application. After that I load autoload.php.

现在,我想将客户发送到eWay付款站点,以选择付款方式(贝宝,抄送)以及贝宝/抄送信息.这样,客户就可以感觉到他们正在通过eWay付款网关进行付款.我的控制器方法中有以下代码::

Now I want to send customer into eWay payment site for choose payment method(paypal, CC) as well as paypal/CC information. So that customer can feel that they are paying by eWay payment gateway. I have the following code into my controller method ::

$apiKey = '5XwiMIQ3EBkSlP5XwiMIQ3EBkSlP5XwiMIQ3EBkSlP...................';
    $apiPassword = '12222......';
    $apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live

    $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

    $transaction = [
        'RedirectUrl' => 'http://www.eway.com.au',
        'CancelUrl' => "http://www.eway.com.au",
        'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
        'Payment' => [
            'TotalAmount' => 1000,
        ]
    ];

    $response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);

它返回连接到Rapid Gateway时出错" |错误代码 S9992 我也按照网址 https://github.com/eWAYPayment/eway-rapid-php

Its returning the "Error connecting to Rapid gateway" | error code S9992Also I followed the url https://github.com/eWAYPayment/eway-rapid-php

我想念什么吗?你能帮帮我吗?感谢进阶.

Do I miss anything ? Would you please help me out ? Thanks in Advanced.

推荐答案

在Mac OSX上使用XAMPP,我遇到了完全相同的Eway S9992问题.我设法从此处下载最新的CA捆绑包来解决此问题:

I have had the exact same Eway S9992 issue using XAMPP on Mac OSX. I managed to fix the issue by downloading the latest CA bundle from here:

https://curl.haxx.se/ca/cacert.pem

将其保存到我的/Applications/XAMPP/etc/文件夹中,然后编辑我的XAMPP/etc/php.ini文件并更新openssl.cafile的路径:

Saving it to my /Applications/XAMPP/etc/ folder then editing my XAMPP/etc/php.ini file and updating the path to the openssl.cafile:

openssl.cafile=/Applications/XAMPP/etc/cacert.pem

重新启动Apache并成功了!

Restarted Apache and it worked a treat!

这篇关于如何在PHP中集成eWay支付系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 00:34