|
@@ -12,8 +12,11 @@ class SanJinService extends BaseService
|
|
|
// SanJin payment service methods would go here
|
|
// SanJin payment service methods would go here
|
|
|
const REQUEST_URL = 'https://api.qbdf13.com/';
|
|
const REQUEST_URL = 'https://api.qbdf13.com/';
|
|
|
|
|
|
|
|
- const ALIPAY_TO_CARD = 'DF001'; // 支付宝转银行卡
|
|
|
|
|
|
|
+ const ALIPAY_TO_CARD = 'DF001'; // 支付宝转卡
|
|
|
const ALIPAY_TO_ALIPAY = 'DF002'; // 支付宝转支付宝
|
|
const ALIPAY_TO_ALIPAY = 'DF002'; // 支付宝转支付宝
|
|
|
|
|
+ const PROVISION_TO_CARD = 'DF003'; // 备付金转卡
|
|
|
|
|
+ const PROVISION_TO_ALIPAY = 'DF004'; // 备付金转支付宝
|
|
|
|
|
+ const NUMBER_RMB = 'DF005'; // 数字人民币
|
|
|
|
|
|
|
|
// 获取异步的通知地址
|
|
// 获取异步的通知地址
|
|
|
public static function getNotifyUrl()
|
|
public static function getNotifyUrl()
|
|
@@ -60,6 +63,52 @@ class SanJinService extends BaseService
|
|
|
return json_decode($body->getContents(), true);
|
|
return json_decode($body->getContents(), true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @description: 查询代付订单信息
|
|
|
|
|
+ * @param {*} $order_no 代付订单
|
|
|
|
|
+ * @return {array} $result
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function findPayoutOrderInfo($order_no)
|
|
|
|
|
+ {
|
|
|
|
|
+ $merchant_id = config('app.tree_payment_merchant_id');
|
|
|
|
|
+ $secret = config('app.tree_payment_secret');
|
|
|
|
|
+
|
|
|
|
|
+ $data = [];
|
|
|
|
|
+ $data['merchantNum'] = $merchant_id;
|
|
|
|
|
+ $data['orderNo'] = $order_no;
|
|
|
|
|
+ $sign = md5($merchant_id.$order_no.$secret);
|
|
|
|
|
+ $data['sign'] = $sign;
|
|
|
|
|
+ $client = self::getClient();
|
|
|
|
|
+ $response = $client->get('api/findPayoutOrderInfo', [
|
|
|
|
|
+ 'query' => $data,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $body = $response->getBody();
|
|
|
|
|
+ return json_decode($body->getContents(), true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @description: 查询代收订单信息
|
|
|
|
|
+ * @param {*} $order_no 代收订单
|
|
|
|
|
+ * @return {array} $result
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function findPayOrderInfo($order_no)
|
|
|
|
|
+ {
|
|
|
|
|
+ $merchant_id = config('app.tree_payment_merchant_id');
|
|
|
|
|
+ $secret = config('app.tree_payment_secret');
|
|
|
|
|
+
|
|
|
|
|
+ $data = [];
|
|
|
|
|
+ $data['merchantNum'] = $merchant_id;
|
|
|
|
|
+ $data['orderNo'] = $order_no;
|
|
|
|
|
+ $sign = md5($merchant_id.$order_no.$secret);
|
|
|
|
|
+ $data['sign'] = $sign;
|
|
|
|
|
+ $client = self::getClient();
|
|
|
|
|
+ $response = $client->get('api/findPayOrderInfo', [
|
|
|
|
|
+ 'query' => $data,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $body = $response->getBody();
|
|
|
|
|
+ return json_decode($body->getContents(), true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 代收
|
|
// 代收
|
|
|
public static function pay($amount, $order_no, $payType = self::ALIPAY_TO_ALIPAY)
|
|
public static function pay($amount, $order_no, $payType = self::ALIPAY_TO_ALIPAY)
|
|
|
{
|
|
{
|
|
@@ -105,6 +154,15 @@ class SanJinService extends BaseService
|
|
|
$data['notifyUrl'] = $notify_url;
|
|
$data['notifyUrl'] = $notify_url;
|
|
|
$data['payType'] = $payType;
|
|
$data['payType'] = $payType;
|
|
|
|
|
|
|
|
|
|
+ switch($payType){
|
|
|
|
|
+ case self::ALIPAY_TO_ALIPAY:
|
|
|
|
|
+ $bankName = '支付宝';
|
|
|
|
|
+ break;
|
|
|
|
|
+ case self::NUMBER_RMB:
|
|
|
|
|
+ $bankName = '数字人民币';
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$signStr = $merchant_id . $order_no . $amount . $secret;
|
|
$signStr = $merchant_id . $order_no . $amount . $secret;
|
|
|
$sign = md5($signStr);
|
|
$sign = md5($signStr);
|
|
|
$data['sign'] = $sign;
|
|
$data['sign'] = $sign;
|