1. Go to this page and download the library: Download yuansfer/yuansfer-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yuansfer / yuansfer-php-sdk example snippets
use Yuansfer\Yuansfer;
$config = array(
Yuansfer::MERCHANT_NO => 'The merchant NO.',
Yuansfer::STORE_NO => 'The store NO.',
Yuansfer::API_TOKEN => 'Yuansfer API token',
Yuansfer::TEST_API_TOKEN => 'Yuansfer API token for test mode',
Yuansfer::MER_GROUP_NO => 'The merchant group NO, optional.',
);
$yuansfer = new Yuansfer($config);
$api = $yuansfer->createSecurePay();
$api
->setAmount(9.9) //The amount of the transaction.
->setCurrency('USD') // The currency, USD, CAD supported yet.
->setSettleCurrency('USD') // When the currency is "GBP", the settlement currency is "GBP". All other currencies settle with "USD"
->setVendor('alipay') // The payment channel, alipay, wechatpay, unionpay, enterprisepay are supported yet.
->setReference('44444') //The unque ID of client's system.
->setIpnUrl('http://domain/example/callback_secure_pay_ipn.php') // The asynchronous callback method.
->setCallbackUrl('http://domain/example/callback_secure_pay.php'); // The Synchronous callback method.