PHP code example of yhdjy025 / weimob-php-sdk

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

    

yhdjy025 / weimob-php-sdk example snippets


//se Weimob\Oauth\Oauth;
use Weimob\Api\Api;

//a simple example
$oauth = new Oauth([
    'clientId'                => 'demoapp',    // The client ID assigned to you by the provider
    'clientSecret'            => 'demopass',   // The client password assigned to you by the provider
    'redirectUri'             => 'http://example.com/your-redirect-url/',
    'urlAuthorize'            => 'http://brentertainment.com/oauth2/lockdin/authorize',
    'urlAccessToken'          => 'http://brentertainment.com/oauth2/lockdin/token',
    'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource'
]);
$token = $oauth->auth();

$api = new Api($token['accessToken']);
try {
    $result = $api->send('wangpu/Order/FullInfoGetHighly', [
        'order_no' => '201806211425',
        'shop_id' => '123456'
    ]);
    var_dump($result);
} catch (\Exception $e) {
    echo $e->getMessage();
}