| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php
- namespace addons\HuijuBill\common\logic;
- use common\logic\middleground\base\ApiAbstract;
- /**
- * 汇聚分账
- */
- class PayApiLogic extends ApiAbstract
- {
- /**
- * API列表
- *
- * @var array
- */
- public $api_list = [
- 'create_order' => 'hj/order/create', // 创建支付订单
- 'order_query' => 'hj/order/query', // 订单查询
- 'mch_info' => 'hj/mch/info', // 分账方信息
- 'order_refund' => 'hj/order/refund', // 订单退款
- 'order_refund_query' => 'hj/order/refundQuery', // 退款查询
- 'order_alt_list' => 'hj/order/altList', // 分账列表
- 'order_settle_list' => 'hj/order/settleList', // 结算记录
- 'sign_content' => 'hj/mch/signContent', // 签约内容
- 'confirm_sign' => 'hj/mch/confirmSign', // 确认签约
- ];
- /**
- * 创建支付订单
- *
- * @param array $params
- * @return array
- */
- public function create_order($params)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter($params), 'post');
- }
- /**
- * 订单查询
- *
- * @param string $order_no
- * @return array
- */
- public function order_query($sys_order_no)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter(compact('sys_order_no')), 'get');
- }
- /**
- * 订单退款
- *
- * @param array $params
- * [
- * 'order_no' => '商户订单号'
- * 'refund_order_no' => '退款订单号'
- * 'refund_amount' => '退款金额'
- * 'reason' => '退款理由'
- * 'notify_url' => '通知地址'
- * ]
- * @return array
- */
- public function order_refund($params)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter($params), 'post');
- }
- /**
- * 退款订单查询
- *
- * @param string $refund_order_no 退款订单号
- * @return array
- */
- public function order_refund_query($refund_order_no)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter(compact('refund_order_no')), 'get');
- }
- /**
- * 查询分账
- *
- * @param string $start_time 2022-03-01
- * @param string $end_time 2022-03-01
- * @param string $order_no 流水单号
- * @param integer $page
- * @return array
- */
- public function order_alt_list($start_time, $end_time, $order_no = '', $page = 1)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter(compact(
- 'start_time',
- 'end_time',
- 'order_no',
- 'page'
- )), 'get');
- }
- /**
- * 查询结算记录
- *
- * @param string $start_time 2022-03-01
- * @param string $end_time 2022-03-01
- * @param integer $page
- * @return array
- */
- public function order_settle_list($start_time, $end_time, $page = 1)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter(compact(
- 'start_time',
- 'end_time',
- 'page'
- )), 'get');
- }
- /**
- * 分账方信息
- *
- * @param string $alt_mch_no
- * @return array
- */
- public function mch_info($alt_mch_no)
- {
- return $this->request($this->getFullUrl(__FUNCTION__), array_filter(compact(
- 'alt_mch_no'
- )), 'get');
- }
- /**
- * 获取签约内容
- *
- * @return string
- */
- public function sign_content()
- {
- return $this->request($this->getFullUrl(__FUNCTION__), [], 'get');
- }
- /**
- * 执行确认签约
- *
- * @return boolean
- */
- public function confirm_sign()
- {
- return $this->request($this->getFullUrl(__FUNCTION__), [], 'get');
- }
- }
|