fix:支付
This commit is contained in:
@@ -47,7 +47,7 @@ func (l *CreateOrderLogic) CreateOrder(req *types.CreateOrderReq, userinfo *auth
|
||||
OriginalCurrency: string(constants.CURRENCYUSD),
|
||||
UserId: userinfo.UserId,
|
||||
CartIds: req.CartIds,
|
||||
DeliveryMethod: req.DeliveryMethod,
|
||||
DeliveryMethod: constants.DELIVERYMETHODDSCLOUDSTORE,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fusenapi/service/repositories"
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
|
||||
@@ -38,7 +39,22 @@ func (l *CreatePrePaymentByBalanceLogic) CreatePrePaymentByBalance(req *types.Cr
|
||||
return resp.SetStatus(basic.CodeUnAuth)
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
res, err := l.svcCtx.Repositories.NewOrder.CreatePrePaymentByBalance(l.ctx, &repositories.CreatePrePaymentByBalanceReq{
|
||||
UserId: userinfo.UserId,
|
||||
OrderSn: req.OrderSn,
|
||||
Country: "US",
|
||||
Currency: "usd",
|
||||
StripeKey: l.svcCtx.Config.PayConfig.Stripe.Key,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return resp.SetStatus(&res.ErrorCode)
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK, map[string]interface{}{
|
||||
"order_detail": res.OrderDetail,
|
||||
"order_pay": res.OrderPay,
|
||||
})
|
||||
}
|
||||
|
||||
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||
|
||||
@@ -10,8 +10,7 @@ type OrderDetailReq struct {
|
||||
}
|
||||
|
||||
type CreateOrderReq struct {
|
||||
CartIds []int64 `json:"cart_ids"`
|
||||
DeliveryMethod int64 `json:"delivery_method,optional,options=[1,2],default=2"`
|
||||
CartIds []int64 `json:"cart_ids"`
|
||||
}
|
||||
|
||||
type CreatePrePaymentByDepositReq struct {
|
||||
|
||||
Reference in New Issue
Block a user