|
@@ -0,0 +1,49 @@
|
|
|
+<?php
|
|
|
+namespace app\common\service;
|
|
|
+
|
|
|
+use addons\epay\library\Service;
|
|
|
+use app\common\model\Orders;
|
|
|
+use app\common\model\Payment;
|
|
|
+use fast\Arr;
|
|
|
+use think\App;
|
|
|
+
|
|
|
+class OrderPaySuccService{
|
|
|
+ /** @var Payment */
|
|
|
+ protected $payment;
|
|
|
+ protected $methods=[
|
|
|
+ Orders::PT_QYWY=>'companyBank',
|
|
|
+ Orders::PT_WX=>'wechat',
|
|
|
+ Orders::PT_ZFB=>'alipay',
|
|
|
+ Orders::PT_YL=>'bankUnion',
|
|
|
+ Orders::PT_DF=>'otherUser',
|
|
|
+ Orders::PT_OFF=>'offline',
|
|
|
+ ];
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Payment $payment
|
|
|
+ */
|
|
|
+ public function setPayment(Payment $payment): void
|
|
|
+ {
|
|
|
+ $this->payment = $payment;
|
|
|
+ }
|
|
|
+ public function companyBank(){}
|
|
|
+ public function wechat(){
|
|
|
+
|
|
|
+ }
|
|
|
+ public function notifyUrl(){
|
|
|
+ return request()->root(true)."/index/payment/notify/order_no/".$this->payment->order_no;
|
|
|
+ }
|
|
|
+ public function returnUrl(){
|
|
|
+ return request()->root(true);
|
|
|
+ }
|
|
|
+ public function alipay(){
|
|
|
+
|
|
|
+ }
|
|
|
+ public function bankUnion(){}
|
|
|
+ public function otherUser(){}
|
|
|
+ public function offline(){}
|
|
|
+ public function process(){
|
|
|
+ $method=Arr::get($this->methods,$this->payment->pay_type);
|
|
|
+ return App::invokeMethod([$this,$method]);
|
|
|
+ }
|
|
|
+}
|