fix(payment): add help_image_url to checkout-info API response

The help image configured in admin was missing from the checkout page
because it was not included in the checkoutInfoResponse struct.
This commit is contained in:
erio
2026-04-08 13:16:09 +08:00
parent 42a0b523fa
commit 7295fce5fd
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.108.87
0.1.108.88
@@ -127,6 +127,7 @@ func (h *PaymentHandler) GetCheckoutInfo(c *gin.Context) {
Plans: planList,
BalanceDisabled: cfg.BalanceDisabled,
HelpText: cfg.HelpText,
HelpImageURL: cfg.HelpImageURL,
StripePublishableKey: cfg.StripePublishableKey,
})
}
@@ -138,6 +139,7 @@ type checkoutInfoResponse struct {
Plans []checkoutPlan `json:"plans"`
BalanceDisabled bool `json:"balance_disabled"`
HelpText string `json:"help_text"`
HelpImageURL string `json:"help_image_url"`
StripePublishableKey string `json:"stripe_publishable_key"`
}
+1
View File
@@ -63,6 +63,7 @@ export interface CheckoutInfoResponse {
plans: SubscriptionPlan[]
balance_disabled: boolean
help_text: string
help_image_url: string
stripe_publishable_key: string
}
+6 -3
View File
@@ -80,8 +80,11 @@
<SubscriptionPlanCard v-for="plan in checkout.plans" :key="plan.id" :plan="plan" @select="openSubscribeDialog" />
</div>
</template>
<div v-if="checkout.help_text" class="card p-4">
<p class="text-sm text-gray-500 dark:text-gray-400">{{ checkout.help_text }}</p>
<div v-if="checkout.help_text || checkout.help_image_url" class="card p-4">
<div :class="checkout.help_image_url && checkout.help_text ? 'flex items-start gap-4' : ''">
<img v-if="checkout.help_image_url" :src="checkout.help_image_url" alt="" class="h-24 w-24 rounded-lg object-contain" />
<p v-if="checkout.help_text" class="text-sm text-gray-500 dark:text-gray-400">{{ checkout.help_text }}</p>
</div>
</div>
</template>
</div>
@@ -153,7 +156,7 @@ const selectedPlan = ref<SubscriptionPlan | null>(null)
// All checkout data from single API call
const checkout = ref<CheckoutInfoResponse>({
methods: {}, global_min: 0, global_max: 0,
plans: [], balance_disabled: false, help_text: '', stripe_publishable_key: '',
plans: [], balance_disabled: false, help_text: '', help_image_url: '', stripe_publishable_key: '',
})
const tabs = computed(() => {