作者 anyv
1 个管道 的构建 通过 耗费 0 秒

支付

... ... @@ -24,6 +24,9 @@ class PayController extends HomeBaseController
'payment' => config('wechat_config.payment'),
];
}
public function test(){
dump(cache('result'));
}
/**
* 微信支付
... ... @@ -54,7 +57,7 @@ class PayController extends HomeBaseController
$app = new Application($this->options);
$payment = $app->payment;
$result = $payment->prepare($order);
cache('result',$result);
if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS'){
$prepayId = $result->prepay_id;
$jsApiParameters=$payment->configForJSSDKPayment($prepayId);
... ...