Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
@@ -219,26 +219,26 @@ func (l *StripeWebhookLogic) HandleChargeRefunded(chargeRefunded *stripe.Charge)
|
||||
}
|
||||
|
||||
// session完成
|
||||
func (l *StripeWebhookLogic) handlePaymentSessionCompleted(sessionId string, tradeNo string) (err error) {
|
||||
// 查询支付记录
|
||||
payModel := gmodel.NewFsPayModel(l.svcCtx.MysqlConn)
|
||||
rsbPay := payModel.RowSelectBuilder(nil)
|
||||
rsbPay = rsbPay.Where("session_id = ?", sessionId)
|
||||
payInfo, err := payModel.FindOneByQuery(l.ctx, rsbPay, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if *payInfo.PayStatus == 0 {
|
||||
*payInfo.TradeNo = tradeNo
|
||||
_, err = payModel.CreateOrUpdate(l.ctx, payInfo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return errors.New("pay status 1")
|
||||
}
|
||||
return err
|
||||
}
|
||||
// func (l *StripeWebhookLogic) handlePaymentSessionCompleted(sessionId string, tradeNo string) (err error) {
|
||||
// // 查询支付记录
|
||||
// payModel := gmodel.NewFsPayModel(l.svcCtx.MysqlConn)
|
||||
// rsbPay := payModel.RowSelectBuilder(nil)
|
||||
// rsbPay = rsbPay.Where("session_id = ?", sessionId)
|
||||
// payInfo, err := payModel.FindOneByQuery(l.ctx, rsbPay, nil)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// if *payInfo.PayStatus == 0 {
|
||||
// *payInfo.TradeNo = tradeNo
|
||||
// _, err = payModel.CreateOrUpdate(l.ctx, payInfo)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// } else {
|
||||
// return errors.New("pay status 1")
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
|
||||
// 付款成功
|
||||
func (l *StripeWebhookLogic) HandleChargeSucceeded(charge *stripe.Charge, eventId string) error {
|
||||
@@ -254,7 +254,7 @@ func (l *StripeWebhookLogic) HandleChargeSucceeded(charge *stripe.Charge, eventI
|
||||
case "product_order":
|
||||
res, err := l.svcCtx.Repositories.NewOrder.PaymentSuccessful(l.ctx, &repositories.PaymentSuccessfulReq{
|
||||
EventId: eventId,
|
||||
PaymentMethod: 1,
|
||||
PaymentMethod: "stripe",
|
||||
Charge: charge,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user