PHP code example of yc-hwc / laravel-akulaku

1. Go to this page and download the library: Download yc-hwc/laravel-akulaku 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/ */

    

yc-hwc / laravel-akulaku example snippets

`
    $config = [
        'akulakuUrl' => '',
    ];
    $akulakuSDK = \PHPAkulaku\AkulakuSDK::config($config);

    return ['redirectUrl' => $akulakuSDK->shopAuth()
        ->api('login')
        ->withQueryString([
            'clientId'     => '',
            'responseType' => 'code',
            'scope'        => 'all',
            'redirectUri'  => '',
        ])
        ->fullUrl()];
`
    $config = [
        'akulakuUrl'  => '',
        'appId'       => '',
        'accessToken' => '',
        'privateKey'  => '',
    ];
    $akulakuSDK = \PHPAkulaku\AkulakuSDK::config($config);
    $response = $akulakuSDK->order()->api('list') // /v1/open/order/list
        ->withBody([
            'pageSize' => 100,
        ])->post();
    print_r($response);
    
    tips: /开头为绝对路径uri,不是/开头为相对路径uri,建议使用绝对路径uri