PHP code example of mpusher / gm-open-sdk-php

1. Go to this page and download the library: Download mpusher/gm-open-sdk-php 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/ */

    

mpusher / gm-open-sdk-php example snippets


composer 

use GM\GMOpenClient;
use GM\config\OpenApiConfig;

#merchatId 商户id
#signId 签名对应id
#publicKey 公钥
#privateKey 私钥
#mod "dev-测试环境,pro-生产环境"

$config = new OpenApiConfig($merchId, $signId, $publicKey, $privatekey, OpenApiConfig::MOD_DEV);

#$uri 接口地址
#请求参数[业务参数,数组传参]
$res = GMOpenClient::instance($config)->call('/openapi/goods/get', $param);