2pay-co / 2pay-php-sdk
2pay php sdk
v1.0.2
2022-08-08 08:22 UTC
Requires
- ext-curl: *
README
Requirements
- CURL extension
Installation
-
Install composer:
$ curl -sS https://getcomposer.org/installer | php
More info about installation on Linux / Unix / OSX and Windows.
-
Run the Composer command to install the latest version of SDK:
php composer.phar require 2pay-co/2pay-php-sdk
-
Require Composer's autoloader in your PHP script (assuming it is in the same directory where you installed Composer):
require('vendor/autoload.php');
Usage
Please see examples
demo
use Pay\TwoPay; use Pay\SecurePay; $secure_param = new SecurePay(); $secure_param->amount = "3.2"; $secure_param->callbackUrl = ""; $secure_param->currency ="USD"; $secure_param->goodsInfo = ""; $secure_param->note = "test order"; $secure_param->description = "order test"; $secure_param->terminal = "ONLINE"; $secure_param->vendor = "alipay"; $secure_param->ipnUrl = ''; $secure_param->reference = (string)time(); $secure_param->timeout = "120"; $two_pay = new TwoPay("merchant_no", "token"); // $res is json string $res = $two_pay->SecurePay($secure_param); var_dump($res);