Skip to content

Latest commit

 

History

History
executable file
·
48 lines (36 loc) · 1.03 KB

README.md

File metadata and controls

executable file
·
48 lines (36 loc) · 1.03 KB

GXChain DES SDK for PHP

Install

You can install this library via Composer:

composer require gxchain/des-sdk-php

Usage

Merchant

<?php
use GXChain\DES\DESMerchantClient;

$privateKey = '5Ka9YjFQtfUUX2Ddnqka...'; // Private Key})
$accountId = '1.2.19'; // Account ID
$DESMerchantClient = new DESMerchantClient($privateKey, $accountId);

$testCase = (object)array(
    'name' => 'XXX',
    'idcard' => 'XXXXXXXXXXXXXXXXXX'
);

$DESMerchantClient->createDataExchangeRequest($testCase, 2, function ($res) use ($DESMerchantClient) {
    $requestId = $res->request_id;
    $DESMerchantClient->getResult($requestId, function ($results) {
        echo json_encode($results);
    });
});

Datasource

<?php
use GXChain\DES\DESDatasourceClient;
$privateKey = '5Ka9YjFQtfUUX2Ddnqka...'; // Private Key})
$accountId = '1.2.19'; // Account ID
$queryURL = 'https://www.baidu.com/';
$DESDatasourceClient = new DESDatasourceClient($privateKey, $accountId, $queryURL);

Dev Documents

https://doc.gxb.io/des/