fix:支付
This commit is contained in:
parent
7573f9ccf6
commit
b7a41d39e3
|
@ -45,7 +45,8 @@ type (
|
|||
}
|
||||
|
||||
PayInfo struct {
|
||||
PayMethod string `json:"pay_method"` // 交易方式
|
||||
PayMethod string `json:"pay_method"` // 支付方式
|
||||
PaymentMethod string `json:"payment_method"` // 交易方式
|
||||
PayTime time.Time `json:"pay_time"` // 支付时间
|
||||
Status gmodel.PayStatus `json:"status"` // 当前状态
|
||||
StatusLink []gmodel.PayStatus `json:"status_link"` // 状态链路
|
||||
|
@ -182,13 +183,14 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
|
|||
var payAmount int64
|
||||
var payTitle string
|
||||
var payTime time.Time
|
||||
var paymentMethod string
|
||||
|
||||
var paymentMethod int64 = 1
|
||||
var payMethod int64 = 1
|
||||
if in.PaymentMethod == "stripe" {
|
||||
paymentMethod = 1
|
||||
payMethod = 1
|
||||
}
|
||||
if in.PaymentMethod == "paypal" {
|
||||
paymentMethod = 2
|
||||
payMethod = 2
|
||||
}
|
||||
|
||||
if in.Charge != nil {
|
||||
|
@ -220,6 +222,9 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
|
|||
brand = string(charge.PaymentMethodDetails.Card.Brand)
|
||||
}
|
||||
}
|
||||
if charge.PaymentMethodDetails.Type != "" {
|
||||
paymentMethod = string(charge.PaymentMethodDetails.Type)
|
||||
}
|
||||
}
|
||||
if charge.Currency != "" {
|
||||
currency = string(charge.Currency)
|
||||
|
@ -253,7 +258,8 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
|
|||
var payStatusLink []gmodel.PayStatus
|
||||
var orderAmount = make(map[string]interface{})
|
||||
var payInfo PayInfo
|
||||
payInfo.PayMethod = in.PaymentMethod
|
||||
payInfo.PayMethod = paymentMethod
|
||||
payInfo.PaymentMethod = in.PaymentMethod
|
||||
payInfo.PayTime = payTime
|
||||
payInfo.TradeNo = tradeSn
|
||||
// 当前状态
|
||||
|
@ -362,7 +368,7 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess
|
|||
TradeSn: &tradeSn,
|
||||
PayAmount: &payAmount,
|
||||
PayStatus: &payStatus,
|
||||
PaymentMethod: &paymentMethod,
|
||||
PaymentMethod: &payMethod,
|
||||
PayStage: &payStageInt,
|
||||
CardSn: &card,
|
||||
CardBrand: &brand,
|
||||
|
|
Loading…
Reference in New Issue
Block a user