PHP code example of hiicash / sdk-for-php

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

    

hiicash / sdk-for-php example snippets

$xslt
$ composer 
$xslt
"hiicash/sdk-for-php": "^0.0.1"
}
$xslt


123456'; // 商户号
$appId = '01hanykjnwebz1a9dnkjfgehtj'; // App ID
$secretKey = 'ErEOQtYoVd76uca4gbDNPiUbNEJP6Y6usdNrKAetxBQQhin07H7dhBfKOiSYypxg'; // 应用私钥
$client = new \HiiCash\Order\Client($mchNo, $appId, $secretKey);

$data = [
    'mchOrderNo' => '20160427210604000490',  // 商户订单号
    'wayCode' => 'BINANCE', // 支付方式
    'amount' => 100, // 支付金额
    'currency' => 'cny', // 货币代码
    'subject' => 'mate 60', // 商品标题
    'body' => [["title" => "华为手机 Mate60 Pro+", "price" => 100, "qt" => 1]],  // 商品描述
];

$ret = $client->create($data);    // 创建订单
print_r($ret);                    // 返回数据