PHP code example of chowjiawei / laravel-help-plugin

1. Go to this page and download the library: Download chowjiawei/laravel-help-plugin 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/ */

    

chowjiawei / laravel-help-plugin example snippets

 artisan extend --chinese 
 artisan extend  

$tiktokService= new TTV2Service();
$tiktokService->query("站内订单号,非抖音侧订单号");
正确时返回数组 其余返回空数组

$tiktokService= new TTV2Service();
$tiktokService->refund("站内订单号,非抖音侧订单号", '价格 为分', '$itemOrderId');
正确时返回true 其余返回false

        $item= [
            [
                "item_order_id" => '',
                "refund_amount" => (int)$price
            ],
            [
                "item_order_id" => '',
                "refund_amount" => (int)$price
            ],
        ];

$tiktokService= new TTV2Service();
$tiktokService->refundManyItem("站内订单号,非抖音侧订单号",$item);
正确时返回true 其余返回false

$tiktokService= new TTV2Service();
$tiktokService->agreeRefund("站内订单号,非抖音侧订单号");
正确时返回true 其余返回false

$tiktokService= new TTV2Service();
$tiktokService->getRefund("站内订单号,非抖音侧订单号");
返回数组

$tiktokService= new TTV2Service();
$tiktokService->settle("站内订单号,非抖音侧订单号", "分账描述");
正确时返回true 其余返回false


$settingData = [
 'create_order_callback' => "", 
 'refund_callback' => "",
 'pay_callback' => "",
 ];

$tiktokService= new TTV2Service();
$tiktokService->settingReturn(array $settingData=[]);
正确时返回true 其余返回false

$tiktokService= new TTV2Service();
$tiktokService->getSettingReturn();
正确时返回数组,其余返回空数组

$tiktokService= new TTV2Service();
$tiktokService->return($request);  //控制器内 直接将接受的Request $request 传入return方法,即可自动验签,并返回接收参数

返回 `status` 正确为`true` 附带 `data`数据    错误为 `false`

$tiktokService->returnOK(); 

$tiktokService->returnError($result='失败原因,可省略'); 

$tiktokService= new TTV2Service();
$tiktokService->return($request);  //控制器内 直接将接受的Request $request 传入return方法,即可自动验签,并返回接收参数

$tiktokService->returnOK(); 

$tiktokService->returnError($result='失败原因,可省略'); 

$itemOrderId = json_decode($extendItem['msg'], true)['goods'][0]['item_order_id_list'][0];

$tiktokService= new TTV2Service();
$tiktokService->refundReturn($request); 

$tiktokService->returnOK(); 

$tiktokService->returnError($result='失败原因,可省略'); 

$tiktokService= new TTV2Service();
$tiktokService->settleCallback($request); 

$tiktokService->returnOK(); 

$tiktokService->returnError($result='失败原因,可省略'); 

use Chowjiawei\Helpers\Channels\DingtalkRobotChannel;

public function via($notifiable)
{
    return [DingtalkRobotChannel::class];
}

use Chowjiawei\Helpers\Channels\WechatRobotChannel;

public function via($notifiable)
{
    return [WechatRobotChannel::class];
}

use Chowjiawei\Helpers\Channels\WechatTemplateMessageChannel;

public function via($notifiable)
{
    return [WechatTemplateMessageChannel::class];
}

Notification::route('dingtalk_robot', $key)->notify(new YourNotification());
Notification::route('wechat_robot', $key)->notify(new YourNotification());
Notification::route('Wechat_template_message', $key)->notify(new YourNotification());

use Chowjiawei\Helpers\Channels\DingtalkRobotChannel;

public function via($notifiable)
{
    return [DingtalkRobotChannel::class];
}