PHP code example of 1099438829 / jeepay-php-sdk

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

    

1099438829 / jeepay-php-sdk example snippets


//支付网关地址
$payHost = 'https://www.jeequan.com';
$mchNo = 'yourMchNo';
$appId = 'yourAppId';
$apiKey = 'yourApiKey';

$jeepayClient = new JeepayClient($payHost,$mchNo,$appId,$apiKey);
$params = [
    'amount' => 100,
    'currency' => 'CNY',
];

// 发送 GET 请求
try {
    $response = $jeepayClient->getContent($url, $params);
    print_r($response->getData());
} catch (\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

// 发送 POST 请求
try {
    $postData = [
        'orderNo' => '123456',
        'amount' => 100,
    ];
    $response = $jeepayClient->postForm($url, $postData);
    print_r($response->getData());
} catch (\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}