PHP code example of xeemosion / xeepush

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

    

xeemosion / xeepush example snippets


use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$data = [
    'channel_id' => "你的通道 id",
    'title' => "推送到Telegram", ,
    'push_data' => "
📦 <b>新订单通知</b> 📦
📝 交易号:%s
📝 订单号:<code>%s</code> 👈 <b>点击复制</b>
💰 支付金额:%.2f CNY
📈 实际支付金额:%.2f %s
📊 钱包地址:<code>%s</code>
🕰️ 订单创建时间:%s
🕰️ 支付成功时间:%s
",];
$result = $client->Telegram($data)->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);

use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->Telegram()
    ->set_channel_id("通道 id")
    ->set_title("推送到Telegram")
    ->set_push_data('推送的内容是hello world')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);


use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->email()
    ->set_channel_id("通道 id")
    ->set_title("标题")
    ->set_push_data('推送的内容是hello world')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);

use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->dingTalk()
    ->set_channel_id("通道 id")
    ->set_title("标题")
    ->set_push_data('推送的内容是hello world')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);

use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->wechatCom()
    ->set_channel_id("通道 id")
    ->set_title("标题")
    ->set_push_data('推送的内容是hello world')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);

use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->Telegram()
    ->set_channel_id("通道 id")
    ->set_title("推送到Telegram")
    ->set_push_data('推送的内容是hello world')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);


use Xeemosion\Xeepush\XeeClient;
$client = new XeeClient("你的 appcode");

$res = $client->createOrder()
    ->set_order_id("20140520" . time())
    ->set_amount('10.00')
    ->set_pay_type('usdt')
    ->set_notify_url('https://api.ipv6e.com/prod/pay/tron/notify')
    ->set_redirect_url('https://www.baidu.com')
    ->set_app_id('1bx411c7us')
    ->set_user_id('100012222222')
    ->request();
if ($res['code'] != 200) {
    //返回错误信息
    return $res['message'];
} 
//推送成功后返回的数据
print_r($res['data']);