feat: 添加重新充值会员API功能
This commit is contained in:
parent
29ffd9f8c5
commit
c059df525c
@ -99,6 +99,32 @@ class StoreController extends BaseApiController
|
|||||||
return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]);
|
return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新充值会员
|
||||||
|
*/
|
||||||
|
public function again_recharge()
|
||||||
|
{
|
||||||
|
$auth_code = $this->request->post('auth_code'); //微信支付条码
|
||||||
|
$id = $this->request->post('id',0); //id
|
||||||
|
$order = UserRecharge::where('id', $id)->where('paid',0)->find();
|
||||||
|
if(!$order){
|
||||||
|
return $this->fail('订单不存在');
|
||||||
|
}
|
||||||
|
$order['pay_price']=$order['price'];
|
||||||
|
$result = PaymentLogic::codepay($auth_code, $order,'条码支付');
|
||||||
|
if (PaymentLogic::hasError()) {
|
||||||
|
return $this->fail(PaymentLogic::getError());
|
||||||
|
}
|
||||||
|
if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') {
|
||||||
|
PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result);
|
||||||
|
} else {
|
||||||
|
Redis::send('send-code-pay', ['order_id' => $order['order_id'],'pay_type'=>'recharge']);
|
||||||
|
return $this->success('用户支付中');
|
||||||
|
}
|
||||||
|
return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门店会员充值数量
|
* 门店会员充值数量
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user