链街Dcat后台
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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Common;
  3. use Graze\GuzzleHttp\JsonRpc\Client;
  4. class Rpc
  5. {
  6. const SEPARATE_ACCOUNTS = "/order/onlineComplete";
  7. const ORDER_REFUND = "/order/onlineRefund";
  8. /**
  9. * 订单完成时分账流水
  10. * @param $oid
  11. * @param $uid
  12. * @return string
  13. */
  14. public static function separateAccounts($global_order_id,$uid){
  15. $client = Client::factory(env('RPC_SITE_HOST'));
  16. $request = $client->request(
  17. uniqid(),
  18. self::SEPARATE_ACCOUNTS,
  19. ['global_order_id' => $global_order_id,'user_id'=>$uid]);
  20. $response = $client->send($request);
  21. return $response->getBody()->getContents();
  22. }
  23. public static function orderRefund($global_order_id,$uid){
  24. $client = Client::factory(env('RPC_SITE_HOST'));
  25. $request = $client->request(
  26. uniqid(),
  27. self::ORDER_REFUND,
  28. ['global_order_id' => $global_order_id,'user_id'=>$uid]);
  29. $response = $client->send($request);
  30. return $response->getBody()->getContents();
  31. }
  32. }