PHP code example of asa-charles-ho / dada

1. Go to this page and download the library: Download asa-charles-ho/dada 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/ */

    

asa-charles-ho / dada example snippets


    use AsaHoCharlesHo\Dada\Builder;
    use AsaHoCharlesHo\Dada\Dada;
    
    $app_key = '****'; // 达达开发者app_key
    
    $app_secret = '****'; // 达达开发者app_secret
    
    $source_id = '****'; // 绑定商户的商户 ID
    
    $handler = (new Builder($source_id))
        ->setAppKey($app_key)
        ->setAppSecret($app_secret)
    //    ->turnToOnline() // 是否调用达达的线上接口,默认为测试接口
        ->build();
   

    $dada = new Dada($handler);
    $response = $shop->getCityList();