Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dc0fa5e
feat(payment): add Jeepay top-up integration
Calcium-Ion Apr 4, 2026
58ccff8
fix(payment): support jeepay notify form payloads
Calcium-Ion Apr 4, 2026
ce0f916
feat(payment): support jeepay qr payment modes
Calcium-Ion Apr 4, 2026
39e44d2
chore(ui): refine jeepay payment settings copy
Calcium-Ion Apr 4, 2026
e5c16fc
chore(ui): refine jeepay links copy
Calcium-Ion Apr 4, 2026
51daf44
chore(ui): update jeepay settings description
Calcium-Ion Apr 4, 2026
7e13d10
fix(ui): avoid clearing jeepay api key on empty save
Calcium-Ion Apr 4, 2026
5520c11
feat(ui): improve jeepay qr payment modal
Calcium-Ion Apr 4, 2026
cdca4b9
feat(payment): poll jeepay qr order status
Calcium-Ion Apr 4, 2026
36cca76
feat(payment): add jeepay order timeout settings
Calcium-Ion Apr 4, 2026
86a01c0
chore(ui): remove jeepay notify and return url fields
Calcium-Ion Apr 4, 2026
059dbd5
chore(payment): improve jeepay error logging
Calcium-Ion Apr 4, 2026
7d50d42
fix(payment): send jeepay expired time in seconds
Calcium-Ion Apr 4, 2026
3949fb2
chore(ui): update jeepay icon
Calcium-Ion Apr 4, 2026
db8bc8c
chore(ui): refine jeepay qr modal layout
Calcium-Ion Apr 4, 2026
1df0f87
chore(ui): set default jeepay base url
Calcium-Ion Apr 4, 2026
286a42d
feat(ui): handle expired jeepay qr state
Calcium-Ion Apr 4, 2026
8d52408
chore(ui): move jeepay settings after waffo
Calcium-Ion Apr 4, 2026
71a24ed
chore(ui): update jeepay icon in confirm modal
Calcium-Ion Apr 4, 2026
166b95a
chore(ui): update jeepay registration links
Calcium-Ion Apr 4, 2026
55de524
fix(ui): refine jeepay copy and expiry countdown
Calcium-Ion Apr 4, 2026
4267c8f
fix(ui): prevent jeepay countdown from restarting
Calcium-Ion Apr 4, 2026
75032c4
fix(payment): tighten jeepay callback and expiry handling
Calcium-Ion Apr 4, 2026
b0e43e3
Merge pull request #1 from jeequan/feature/jeepay-topup-integration
jeequan Apr 4, 2026
bd222d4
Merge branch 'QuantumNous:main' into main
jeequan Apr 5, 2026
90fcc13
Merge branch 'QuantumNous:main' into main
jeequan Apr 5, 2026
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.Itoa(setting.JeepayMinTopUp),
})
}
}
Comment on lines +81 to +98

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Expose the effective Jeepay limits here, not the raw option values.

Line 95 and Lines 106-117 return setting.JeepayMinTopUp / setting.JeepayOrderTimeoutMinutes directly, but the Jeepay flow already normalizes non-positive values via getJeepayMinTopUp() and getJeepayOrderTimeoutMinutes() in controller/topup_jeepay.go:66-80. When those stored values are unset or malformed, the UI will enable low amounts or show a zero-minute expiry while the backend enforces different limits.

💡 Proposed fix
 	if enableJeepay {
 		hasJeepay := false
 		for _, method := range payMethods {
 			if method["type"] == PaymentMethodJeepay {
@@
 		if !hasJeepay {
 			payMethods = append(payMethods, map[string]string{
 				"name":      "Jeepay",
 				"type":      PaymentMethodJeepay,
 				"color":     "rgba(var(--semi-green-5), 1)",
-				"min_topup": strconv.Itoa(setting.JeepayMinTopUp),
+				"min_topup": strconv.FormatInt(getJeepayMinTopUp(), 10),
 			})
 		}
 	}
@@
-		"enable_jeepay_topup":          enableJeepay,
-		"jeepay_way_code":              getJeepayWayCode(),
-		"jeepay_order_timeout_minutes": setting.JeepayOrderTimeoutMinutes,
+		"enable_jeepay_topup":          enableJeepay,
+		"jeepay_way_code":              getJeepayWayCode(),
+		"jeepay_order_timeout_minutes": getJeepayOrderTimeoutMinutes(),
@@
-		"jeepay_min_topup":    setting.JeepayMinTopUp,
+		"jeepay_min_topup":    getJeepayMinTopUp(),

Also applies to: 104-117

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@controller/topup.go` around lines 81 - 98, The UI is showing raw Jeepay
config values instead of the normalized/validated limits; replace uses of
setting.JeepayMinTopUp and setting.JeepayOrderTimeoutMinutes in
controller/topup.go with the normalized accessors getJeepayMinTopUp() and
getJeepayOrderTimeoutMinutes() (the same functions used in
controller/topup_jeepay.go) wherever you build payMethods entries or return
Jeepay limits so the frontend receives the effective limits the backend actually
enforces.


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": setting.JeepayOrderTimeoutMinutes,
"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": setting.JeepayMinTopUp,
"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