PHP code example of phpvcn / omnipay-express

1. Go to this page and download the library: Download phpvcn/omnipay-express 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/ */

    

phpvcn / omnipay-express example snippets


$gateway = Omnipay::create('AlipayExpress_LegacyCloseTrade');
$gateway->setPartner('partner');
$gateway->setKey('key');
$gateway->setTradeNo('trade_no');//支付宝交易号
$gateway->setOutOrderNo('out_order_no');//商户网站唯 一订单号
$request = $gateway->purchase();
$response = $request->send();

// 返回数据
$response->getRedirectData();
// 返回错误
$error = $response->getError();