Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion controller/topup.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,32 @@ func GetTopUpInfo(c *gin.Context) {
}
}

enableJeepay := isJeepayConfigured()
if enableJeepay {
hasJeepay := false
for _, method := range payMethods {
if method["type"] == PaymentMethodJeepay {
hasJeepay = true
break
}
}
if !hasJeepay {
payMethods = append(payMethods, map[string]string{
"name": "Jeepay",
"type": PaymentMethodJeepay,
"color": "rgba(var(--semi-green-5), 1)",
"min_topup": strconv.FormatInt(getJeepayMinTopup(), 10),
})
}
}

data := gin.H{
"enable_online_topup": operation_setting.PayAddress != "" && operation_setting.EpayId != "" && operation_setting.EpayKey != "",
"enable_stripe_topup": setting.StripeApiSecret != "" && setting.StripeWebhookSecret != "" && setting.StripePriceId != "",
"enable_creem_topup": setting.CreemApiKey != "" && setting.CreemProducts != "[]",
"enable_jeepay_topup": enableJeepay,
"jeepay_way_code": getJeepayWayCode(),
"jeepay_order_timeout_minutes": getJeepayOrderTimeoutMinutes(),
"enable_waffo_topup": enableWaffo,
"waffo_pay_methods": func() interface{} {
if enableWaffo {
Expand All @@ -92,6 +114,7 @@ func GetTopUpInfo(c *gin.Context) {
"creem_products": setting.CreemProducts,
"pay_methods": payMethods,
"min_topup": operation_setting.MinTopUp,
"jeepay_min_topup": getJeepayMinTopup(),
"stripe_min_topup": setting.StripeMinTopUp,
"waffo_min_topup": setting.WaffoMinTopUp,
"amount_options": operation_setting.GetPaymentSetting().AmountOptions,
Expand Down Expand Up @@ -463,4 +486,3 @@ func AdminCompleteTopUp(c *gin.Context) {
}
common.ApiSuccess(c, nil)
}

Loading