diff --git a/.env.example b/.env.example index fecc58f8..ae422cb0 100644 --- a/.env.example +++ b/.env.example @@ -224,6 +224,7 @@ R2_BACKUP_BUCKET=orion-backups # Get Issuer ID from https://pay.google.com/business/console # LOYALTY_GOOGLE_ISSUER_ID=3388000000012345678 # LOYALTY_GOOGLE_SERVICE_ACCOUNT_JSON=/path/to/service-account.json +# LOYALTY_DEFAULT_LOGO_URL=https://yourdomain.com/path/to/default-logo.png # Apple Wallet integration (requires Apple Developer account) # LOYALTY_APPLE_PASS_TYPE_ID=pass.com.example.loyalty diff --git a/app/modules/loyalty/static/admin/js/loyalty-program-edit.js b/app/modules/loyalty/static/admin/js/loyalty-program-edit.js index fe0f7a9b..fd3b97c7 100644 --- a/app/modules/loyalty/static/admin/js/loyalty-program-edit.js +++ b/app/modules/loyalty/static/admin/js/loyalty-program-edit.js @@ -100,6 +100,7 @@ function adminLoyaltyProgramEdit() { try { const payload = this.buildPayload(); + if (!payload) { this.saving = false; return; } if (this.isNewProgram) { const response = await apiClient.post( diff --git a/app/modules/loyalty/static/merchant/js/loyalty-settings.js b/app/modules/loyalty/static/merchant/js/loyalty-settings.js index b2e0bc3c..0cf29711 100644 --- a/app/modules/loyalty/static/merchant/js/loyalty-settings.js +++ b/app/modules/loyalty/static/merchant/js/loyalty-settings.js @@ -52,6 +52,7 @@ function merchantLoyaltySettings() { try { const payload = this.buildPayload(); + if (!payload) { this.saving = false; return; } if (this.isNewProgram) { await apiClient.post('/merchants/loyalty/program', payload); diff --git a/app/modules/loyalty/static/shared/js/loyalty-program-form.js b/app/modules/loyalty/static/shared/js/loyalty-program-form.js index f9cda4be..53244db6 100644 --- a/app/modules/loyalty/static/shared/js/loyalty-program-form.js +++ b/app/modules/loyalty/static/shared/js/loyalty-program-form.js @@ -98,7 +98,10 @@ function createProgramFormMixin() { if (!payload.minimum_purchase_cents) payload.minimum_purchase_cents = null; if (!payload.card_name) payload.card_name = null; if (!payload.card_secondary_color) payload.card_secondary_color = null; - if (!payload.logo_url) payload.logo_url = null; + if (!payload.logo_url) { + this.error = 'Logo URL is required for wallet integration.'; + return null; + } if (!payload.hero_image_url) payload.hero_image_url = null; if (!payload.terms_text) payload.terms_text = null; if (!payload.privacy_url) payload.privacy_url = null; diff --git a/app/modules/loyalty/static/store/js/loyalty-settings.js b/app/modules/loyalty/static/store/js/loyalty-settings.js index 3cd6efa9..711878f6 100644 --- a/app/modules/loyalty/static/store/js/loyalty-settings.js +++ b/app/modules/loyalty/static/store/js/loyalty-settings.js @@ -82,6 +82,7 @@ function loyaltySettings() { try { const payload = this.buildPayload(); + if (!payload) { this.saving = false; return; } let response; if (this.isNewProgram) { diff --git a/app/modules/loyalty/templates/loyalty/shared/program-form.html b/app/modules/loyalty/templates/loyalty/shared/program-form.html index db561671..510b60a2 100644 --- a/app/modules/loyalty/templates/loyalty/shared/program-form.html +++ b/app/modules/loyalty/templates/loyalty/shared/program-form.html @@ -226,9 +226,10 @@
Required for Google Wallet integration. Must be a publicly accessible image URL (PNG or JPG).