From a0dee68882bc8ebcae94f51d5a125abadaacf8e5 Mon Sep 17 00:00:00 2001 From: BCloudOne <40710938+BCloudOne@users.noreply.github.com> Date: Mon, 25 May 2020 19:43:00 +0800 Subject: [PATCH] Add files via upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加网关支付功能 --- src/BCloudOne/PaymentService.php | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/BCloudOne/PaymentService.php b/src/BCloudOne/PaymentService.php index 5e6f57e..5655423 100644 --- a/src/BCloudOne/PaymentService.php +++ b/src/BCloudOne/PaymentService.php @@ -53,6 +53,50 @@ public function WithdrawApply($user_tag, $order_id, $coin, $amount, $address, $a return $res; } + /** + * 发起网关支付订单 + * @param $title + * @param $currency_type + * @param $value + * @param $callback_url + * @param $return_url + * @param $merc_order_id + * @param $order_type + * @param $is_convert + * @return mixed + * @throws BCloudException + */ + public function GatewayApply($title, $currency_type, $value, $callback_url, $return_url, $merc_order_id, $order_type, $is_convert) + { + $param = [ + 'title' => $title, + 'currency_type' => $currency_type, + 'value' => $value, + 'callback_url' => $callback_url, + 'return_url' => $return_url, + 'merc_order_id' => $merc_order_id, + "order_type" => $order_type, + "is_convert" => $is_convert + ]; + $res = $this->post("gateway/apply", $param); + return $res; + } + + /** + * 根据商户订单号查询网关订单信息 + * @param $order_id + * @return mixed + * @throws BCloudException + */ + public function getGatewayOrderById($order_id) + { + $param = [ + 'order_id' => $order_id, + ]; + $res = $this->post("gateway/order_info", $param); + return $res; + } + /** * 根据币种和交易hash查询充值订单信息 * @param string $coin