|
@@ -9,6 +9,7 @@ use app\common\model\Area;
|
|
|
use app\common\model\Mobile;
|
|
|
use app\common\model\MobileInfo;
|
|
|
use app\common\model\MobileOrder;
|
|
|
+use app\common\model\Payment;
|
|
|
use app\common\service\Jdpay;
|
|
|
use app\common\service\SmsSend;
|
|
|
use think\App;
|
|
@@ -209,19 +210,24 @@ class MobileController extends UserApi
|
|
|
$succ=[
|
|
|
'pay_url'=>'',
|
|
|
];
|
|
|
+ $payment=Payment::create([
|
|
|
+ 'order_no'=>session_create_id('payment'),
|
|
|
+ 'amount'=>$mobileOrder['amount'],
|
|
|
+ 'mobile_order_id'=>$mobileOrder['id'],
|
|
|
+ ]);
|
|
|
if($data['pay_type']==1){
|
|
|
- $info=Service::submitOrder($mobileOrder['amount'],
|
|
|
- $mobileOrder['order_no'],'wechat',"购买手机号{$mobileOrder['no']}",
|
|
|
+ $info=Service::submitOrder($payment['amount'],
|
|
|
+ $payment['order_no'],'wechat',"购买手机号{$mobileOrder['no']}",
|
|
|
Service::notifyUrl('wechat',$mobileOrder['no']),$data['return_url']??'','wap');
|
|
|
$succ['pay_url']=$info->getTargetUrl();
|
|
|
}elseif ($data['pay_type']==2){
|
|
|
- $info=Service::submitOrder($mobileOrder['amount'],
|
|
|
- $mobileOrder['order_no'],'alipay',"购买手机号{$mobileOrder['no']}",
|
|
|
+ $info=Service::submitOrder($payment['amount'],
|
|
|
+ $payment['order_no'],'alipay',"购买手机号{$mobileOrder['no']}",
|
|
|
Service::notifyUrl('alipay',$mobileOrder['no']),$data['return_url']??'','wap');
|
|
|
$succ['pay_url']=$info->getTargetUrl();
|
|
|
}elseif ($data['pay_type']==3){
|
|
|
$jdpay=App::invokeClass(Jdpay::class);
|
|
|
- $payData=$jdpay->order($mobileOrder['order_no'],$mobileOrder['amount'],"购买手机号{$mobileOrder['no']}");
|
|
|
+ $payData=$jdpay->order($payment['order_no'],$payment['amount'],"购买手机号{$mobileOrder['no']}");
|
|
|
$succ=array_merge($succ,$payData);
|
|
|
}
|
|
|
return $succ;
|
|
@@ -230,6 +236,7 @@ class MobileController extends UserApi
|
|
|
* 继续支付
|
|
|
* @ApiParams (name=id,description=订单id)
|
|
|
* @ApiParams (name=pay_type,description=支付方式与下单一样)
|
|
|
+ * @ApiParams (name=return_url,description="支付完成回调页面链接")
|
|
|
*/
|
|
|
public function continue_pay(){
|
|
|
$data=$this->_validate([
|
|
@@ -309,4 +316,12 @@ class MobileController extends UserApi
|
|
|
|
|
|
$this->success('',$config);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传开卡资料
|
|
|
+ * @ApiParams (name=id,description=订单id)
|
|
|
+ */
|
|
|
+ public function upload_identity(){
|
|
|
+
|
|
|
+ }
|
|
|
}
|