PHPackages                             gxchain/des-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gxchain/des-sdk-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gxchain/des-sdk-php
===================

GXChain DES SDK for PHP

v1.0.5(7y ago)12183[1 PRs](https://github.com/gxchain/des-sdk-php/pulls)MITPHPPHP &gt;=7.0

Since Aug 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gxchain/des-sdk-php)[ Packagist](https://packagist.org/packages/gxchain/des-sdk-php)[ Docs](https://doc.gxb.io/des/)[ RSS](/packages/gxchain-des-sdk-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

GXChain DES SDK for PHP
=======================

[](#gxchain-des-sdk-for-php)

Install
-------

[](#install)

You can install this library via Composer:

```
composer require gxchain/des-sdk-php
```

Usage
-----

[](#usage)

### Merchant

[](#merchant)

```
 'XXX',
    'idcard' => 'XXXXXXXXXXXXXXXXXX'
);

// Async
$DESMerchantClient->createDataExchangeRequest($testCase, 3, function ($res) use ($DESMerchantClient) {
    if ($res->request_id) {
        $requestId = $res->request_id;
        $DESMerchantClient->getResult($requestId, function ($results) {
            echo json_encode($results);
        });
    } else {
        echo json_encode($res);
    }
});

// Sync
$res = $DESMerchantClient->createDataExchangeRequestSync($testCase, 3);
if ($res->request_id) {
    $results = $DESMerchantClient->getResultSync($res->request_id);
    echo json_encode($results);
} else {
    echo json_encode($res);
}
```

### Datasource

[](#datasource)

```
