PHP code example of ouranoshong / go-pay

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

    

ouranoshong / go-pay example snippets


date_default_timezone_set('Asia/Shanghai');

ayActionRequest();
$response = new \Ouranoshong\GoPay\Response\PayActionResponse();

$config = new \Ouranoshong\GoPay\GoPayConfig();
$client = new \Ouranoshong\GoPay\GoPayClient();

$request->setMerOrderNum('guoguofufu'.time());
$request->setCurrencyType('');
$request->setFeeAmt('');
$request->setTranAmt('');
$request->setTranIP('');
$request->setTranDateTime(date('YmdHis'));
$request->setIsRepeatSubmit('');
$request->setGoodsName('');
$request->setGoodsDetail('');
$request->setBackgroundMerUrl('');


$client->setConfiguration($config);
$client->setHandlerName(Ouranoshong\GoPay\Handler\PayActionHandler::class);
$client->handle($request, $response);

print_r($response->getResult());