PHP code example of shopex / shopex-platform-php-sdk
1. Go to this page and download the library: Download shopex/shopex-platform-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/ */
shopex / shopex-platform-php-sdk example snippets
# 1. 非laravel or lumen 框架
$app_key = '####';
$app_secret = '####';
$is_dev = false;
$sdk = new \Shopex\Components\Client($app_key,$app_secret,$is_dev);
# 2. laravel or lumen 框架 配置按照 shopex_sdk.php中的key在 .env 文件中配置好
$sdk = \Shopex\Facades\ShopexFacade::client();
$path = "Rjletw";
$method = "delivery.order.create";
$params['create_time'] = '2020-08-10 17:15:23';
$params['has_invoice'] = 0;
$params['is_agent_payment'] = 0;
$params['item_list'] = json_encode([["item_id"=>12312,"item_name"=>"测试商品","num"=>1,"price"=>12300,"total_item_fee"=>12300]]);
$params['items_num'] = 1;
$params['notify_url'] = "http://shopex.cn";
$params['order_id'] = "abc13136";
$params['order_type'] = "normal";
$params['shop_id'] = "test001";
$params['pay_status'] = "PAY_FINISH";
$params['pay_type'] = "Online";
$params['platform'] = "FENGNIAO";
$params['position_source'] = "amap";
$params['receiver_address'] = "宜山路";
$params['receiver_lat'] = "31.175366";
$params['receiver_lng'] = "121.419164";
$params['receiver_name'] = "张三";
$params['receiver_phone'] = "13111111111";
$params['total_fee'] = 12300;
$params['total_pay_fee'] = 12300;
$params['user_id'] = "1054182434";
$params['
shell script
composer el or lumen框架
php artisan vendor:publish --tag=shopex-platform-sdk-config
php artisan config:clear
# 修改 config/shopex_sdk.php 在env中添加对应参数