You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
<?php
|
|
|
|
|
|
namespace App\Admin\Common;
|
|
|
|
|
|
use Graze\GuzzleHttp\JsonRpc\Client;
|
|
|
|
class Rpc
|
|
{
|
|
|
|
const SEPARATE_ACCOUNTS = "/order/onlineComplete";
|
|
const ORDER_REFUND = "/order/onlineRefund";
|
|
|
|
|
|
|
|
/**
|
|
* 订单完成时分账流水
|
|
* @param $oid
|
|
* @param $uid
|
|
* @return string
|
|
*/
|
|
public static function separateAccounts($global_order_id,$uid){
|
|
$client = Client::factory(env('RPC_SITE_HOST'));
|
|
$request = $client->request(
|
|
uniqid(),
|
|
self::SEPARATE_ACCOUNTS,
|
|
['global_order_id' => $global_order_id,'user_id'=>$uid]);
|
|
$response = $client->send($request);
|
|
return $response->getBody()->getContents();
|
|
}
|
|
|
|
public static function orderRefund($global_order_id,$uid){
|
|
$client = Client::factory(env('RPC_SITE_HOST'));
|
|
$request = $client->request(
|
|
uniqid(),
|
|
self::ORDER_REFUND,
|
|
['global_order_id' => $global_order_id,'user_id'=>$uid]);
|
|
$response = $client->send($request);
|
|
return $response->getBody()->getContents();
|
|
}
|
|
}
|