|
|
|
@ -92,10 +92,12 @@ class ProfitSharingResult extends Command |
|
|
|
|
//支付信息初始化 |
|
|
|
|
$PaymentModel = new Payment; |
|
|
|
|
$templateInfo = $PaymentModel->getPaymentInfo(PaymentMethodEnum::WECHAT, ClientEnum::MP_WEIXIN, $order->store_id, $order->merchant_id); |
|
|
|
|
|
|
|
|
|
$options = $templateInfo['template']['config'][PaymentMethodEnum::WECHAT]; |
|
|
|
|
$payment = PaymentFacade::store(PaymentMethodEnum::WECHAT)->setOptions($options, ClientEnum::MP_WEIXIN); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var_dump($payment); |
|
|
|
|
// exit(); |
|
|
|
|
|
|
|
|
|
$payment_trade = PaymentTrade::where('trade_id', $order->trade_id)->field('trade_no')->find(); |
|
|
|
|
if (!$payment_trade) { |
|
|
|
@ -105,12 +107,14 @@ class ProfitSharingResult extends Command |
|
|
|
|
$transaction_id = $payment_trade->trade_no; |
|
|
|
|
$sharing = $payment->profitsharingQuery($order->out_order_no, $transaction_id); |
|
|
|
|
var_dump($sharing); |
|
|
|
|
var_dump($sharing->return_code); |
|
|
|
|
var_dump($sharing->result_code); |
|
|
|
|
//更新 |
|
|
|
|
$ret = Order::where('order_id',$order->order_id)->update(['profitsharing_status' => 2, 'profitsharing_time' => time()]); |
|
|
|
|
echo "微信支付分账结果".PHP_EOL; |
|
|
|
|
var_dump($ret); |
|
|
|
|
|
|
|
|
|
if ($sharing['state'] == "FINISHED") { |
|
|
|
|
//更新 |
|
|
|
|
$ret = Order::where('order_id',$order->order_id)->update(['profitsharing_status' => 2, 'profitsharing_time' => time()]); |
|
|
|
|
echo "微信支付分账结果".PHP_EOL; |
|
|
|
|
var_dump($ret); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (\Exception $e) { |
|
|
|
|
echo $e->getMessage(); |
|
|
|
|
continue; |
|
|
|
|