PHP code example of zqhong / omnipay-qpay

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

    

zqhong / omnipay-qpay example snippets




mnipay\Omnipay;

$gateway = Omnipay::getFactory()->create("QPay")
    ->setMchId('')
    ->setMchKey('')
    ->setCertFilePath('')
    ->setKeyFilePath('')
    ->setNotifyUrl('')
    ->setOpUserPasswd('');

// 订单查询
// 参数请参考:https://qpay.qq.com/qpaywiki/showdocument.php?pid=1&docid=5
$queryOrderRequest = $gateway->queryOrder([
    'transaction_id' => '',
]);
$queryOrderResponse = $queryOrderRequest->send();
if ($queryOrderResponse->isSuccessful()) {
    // 订单查询成功操作
}