PHP code example of verystar / pay

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

    

verystar / pay example snippets



Verypay\Pay;

//实例化支付对象
$pay = new Pay(
    [
        'app_key'    => '您的app_key',
        'app_secret' => '您的app_secret'
    ]
);

//实例二:生成唯一订单号
$ret = $pay->unifidoOrder(
    [
        'store_sn'  => '10001',
        'client_sn' => '10001',
        'total_fee' => 10,
        'out_sn'    => '19' . rand(10, 99),
        'body'      => 'test goods',
        'channel'   => 'wx'
    ]
);