PHP code example of evondu / wechat-php-sdk

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

    

evondu / wechat-php-sdk example snippets


$result = $client->payment->payNative([
    "body"          => "test",
    "out_trade_no"  => time(),
    "total_fee"     => 1,
], "notify_url");

$result = $client->payment->payMweb([
    "body"          => "test",
    "out_trade_no"  => time(),
    "total_fee"     => 1,
    "scene_info"    => json_encode([])
], "notify_url");

$result = $client->pappay->apply([
    "body"          => "test",
    "out_trade_no"  => time(),
    "total_fee"     => 1,
    "contract_id"   => "***********"
], "notify_url");

$result = $client->pappay->queryContract([
    "contract_id"   => "***********"
]);