sljdepay / sljdepay-soap
该软件包的规范存储库似乎已消失,因此该软件包已被冻结。
v1.1.1
2017-05-24 11:14 UTC
Requires
- php: >=5.6
Requires (Dev)
- kahlan/kahlan: ^3.0
This package is not auto-updated.
Last update: 2022-04-02 13:20:03 UTC
README
此连接器将不再维护,并将一直列至2021年底。感谢所有信任并使用它的人
Slydepay PHP 连接器
您可以在https://app.slydepay.com.gh/auth/signup#business_reg注册Slydepay商户账户
安装
建议使用Composer安装Slydepay PHP。
$ composer require slydepay/slydepay-soap
这需要Slydepay PHP及其所有依赖项。Slydepay PHP需要PHP 5.6或更高版本。
用法
以下是使用Slydepay PHP连接器处理付款的示例
<?php require 'vendor/autoload.php'; use Slydepay\Order\Order; use Slydepay\Order\OrderItem; use Slydepay\Order\OrderItems; // Instantiate Slydepay $slydepay = new Slydepay\Slydepay("merchantEmail", "merchantSecretKey"); // Create a list of OrderItems with OrderItem objects $orderItems = new OrderItems([ new OrderItem("1234", "Test Product", 10, 2), new OrderItem("1284", "Test Product2", 20, 2), ]); // Shipping and tax pulled either from ini/properties file. Hard coded here for illustration $shippingCost = 20; $tax = 10; // Create the Order object for this transaction. $order = Order::createWithId( $orderItems, "order_id_1", $shippingCost, $tax, "description", "no comment" ); try { // Make request to Slydepay and get the response object for the redirect url $response = $slydepay->processPaymentOrder($order); echo $response->redirectUrl(); } catch (Slydepay\Exception\ProcessPayment $e) { echo $e->getMessage(); }
测试
要执行测试套件,您需要kahlan。
$ kahlan
或者
$ php pathtoproject/vendor/bin/kahlan