Commit 77830390 by lizhilin

更新

parent 4a00cd58
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\Models\Good as GoodModel; use App\Models\Good as GoodModel;
use App\Models\GoodSku; use App\Models\GoodSku;
use Exception;
use NwVVVS\AdapayCore\AdaPay\Payment; use NwVVVS\AdapayCore\AdaPay\Payment;
class Adapay class Adapay
...@@ -168,12 +169,13 @@ public function payNotify($params = []) ...@@ -168,12 +169,13 @@ public function payNotify($params = [])
"description" => "", "description" => "",
"div_members" => "" //分账参数列表 默认是数组List "div_members" => "" //分账参数列表 默认是数组List
); );
//分账列表
$payment_params['div_members'] = OrderDivideRecord::divide($orderObj->id); //返回分账参数列表
Log::add('发起支付确认' . $order_no, $payment_params);
DB::beginTransaction(); DB::beginTransaction();
try { try {
//分账列表
$payment_params['div_members'] = OrderDivideRecord::divide($orderObj->id); //返回分账参数列表
Log::add('发起支付确认' . $order_no, $payment_params);
# 发起支付确认创建 # 发起支付确认创建
$payment_confirm->create($payment_params); $payment_confirm->create($payment_params);
# 对支付确认创建结果进行处理 # 对支付确认创建结果进行处理
...@@ -181,6 +183,7 @@ public function payNotify($params = []) ...@@ -181,6 +183,7 @@ public function payNotify($params = [])
//失败处理 //失败处理
Log::add('支付确认失败', $payment_confirm->result); Log::add('支付确认失败', $payment_confirm->result);
$result = $payment_confirm->result; $result = $payment_confirm->result;
throw new Exception($result['error_msg']);
} else { } else {
//成功处理 //成功处理
Log::add('支付确认成功', $payment_confirm->result); Log::add('支付确认成功', $payment_confirm->result);
...@@ -193,7 +196,7 @@ public function payNotify($params = []) ...@@ -193,7 +196,7 @@ public function payNotify($params = [])
DB::commit(); DB::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
Log::add('支付确认对象失败', $e); Log::add('支付确认对象失败', $e->getMessage());
DB::rollBack(); DB::rollBack();
return false; return false;
} }
......
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
'helpers' => [ 'helpers' => [
'enable' => true, 'enable' => false,
], ],
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment