PHP code example of zobeen / cloud-broadcast

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

    

zobeen / cloud-broadcast example snippets




$data = [
    'pay_type' => zobeen\cloudbroadcast\core\driver\jialian\JiaLianCloudBroadcast::PAY_TYPE['wx'],
    'device_id' => '',
    'order_amount' => 1, // 单位:分
    'create_time' => date('YmdHis'),
    'order_id' => 'o' . date('YmdHis'),
    'store_id' => 1,
];
$client->publishMessage($data);

$client = zobeen\cloudbroadcast\Client::init('alibaba', [
    'access_key_id' => '',
    'access_key_secret' => '',
    'region_id' => 'cn-shanghai',
]);

$data = [
    'product_key' => '',
    'device_name' => '',
    'message' => '测试微信收款0.01元',
];
$client->publishMessage($data);