From 636fc5aec024df2b078b05769c848c9c523ed807 Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Fri, 14 Jul 2023 14:46:20 -0700 Subject: [PATCH] `Paywalls`: updated `PaywallData` field names (#2817) These now match how the frontend is configuring them. --- Sources/Paywalls/PaywallData.swift | 4 ++-- .../Networking/Responses/Fixtures/Offerings.json | 8 ++++---- .../Responses/Fixtures/PaywallData-Sample1.json | 6 +++--- .../PaywallData-missing_current_and_default_locale.json | 4 ++-- .../Fixtures/PaywallData-missing_current_locale.json | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Sources/Paywalls/PaywallData.swift b/Sources/Paywalls/PaywallData.swift index e7770c2cba..e8d7e3b089 100644 --- a/Sources/Paywalls/PaywallData.swift +++ b/Sources/Paywalls/PaywallData.swift @@ -195,8 +195,8 @@ extension PaywallData.LocalizedConfiguration: Codable { private enum CodingKeys: String, CodingKey { case title case subtitle - case callToAction = "cta" - case callToActionWithIntroOffer = "ctaWithIntroOffer" + case callToAction + case callToActionWithIntroOffer case offerDetails case offerDetailsWithIntroOffer } diff --git a/Tests/UnitTests/Networking/Responses/Fixtures/Offerings.json b/Tests/UnitTests/Networking/Responses/Fixtures/Offerings.json index cebc63cb99..07fef12625 100644 --- a/Tests/UnitTests/Networking/Responses/Fixtures/Offerings.json +++ b/Tests/UnitTests/Networking/Responses/Fixtures/Offerings.json @@ -44,16 +44,16 @@ "en_US": { "title": "Paywall", "subtitle": "Description", - "cta": "Purchase now", - "cta_with_intro_offer": "Purchase now", + "call_to_action": "Purchase now", + "call_to_action_with_intro_offer": "Purchase now", "offer_details": "{{ price_per_month }} per month", "offer_details_with_intro_offer": "Start your {{ intro_duration }} trial, then {{ price_per_month }} per month" }, "es_ES": { "title": "Tienda", "subtitle": "Descripción", - "cta": "Comprar", - "cta_with_intro_offer": "Comprar", + "call_to_action": "Comprar", + "call_to_action_with_intro_offer": "Comprar", "offer_details": "{{ price_per_month }} cada mes", "offer_details_with_intro_offer": "Comienza tu prueba de {{ intro_duration }}, y después {{ price_per_month }} cada mes" } diff --git a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-Sample1.json b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-Sample1.json index 8b9c7f5ea0..5cbbfd8381 100644 --- a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-Sample1.json +++ b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-Sample1.json @@ -4,15 +4,15 @@ "en_US": { "title": "Paywall", "subtitle": "Description", - "cta": "Purchase now", - "cta_with_intro_offer": "Purchase now", + "call_to_action": "Purchase now", + "call_to_action_with_intro_offer": "Purchase now", "offer_details": "{{ price_per_month }} per month", "offer_details_with_intro_offer": "Start your {{ intro_duration }} trial, then {{ price_per_month }} per month" }, "es_ES": { "title": "Tienda", "subtitle": "Descripción", - "cta": "Comprar", + "call_to_action": "Comprar", "offer_details": "{{ price_per_month }} cada mes" } }, diff --git a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_and_default_locale.json b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_and_default_locale.json index c9f68c1d80..e1c3f1b869 100644 --- a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_and_default_locale.json +++ b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_and_default_locale.json @@ -4,8 +4,8 @@ "it_IT": { "title": "Paywall", "subtitle": "Description", - "cta": "Purchase now", - "cta_with_intro_offer": "Purchase now", + "call_to_action": "Purchase now", + "call_to_action_with_intro_offer": "Purchase now", "offer_details": "{{ price_per_month }} per month", "offer_details_with_intro_offer": "Start your {{ intro_duration }} trial, then {{ price_per_month }} per month" } diff --git a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_locale.json b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_locale.json index a2f0fa98e5..8a2b766c72 100644 --- a/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_locale.json +++ b/Tests/UnitTests/Networking/Responses/Fixtures/PaywallData-missing_current_locale.json @@ -4,8 +4,8 @@ "es_ES": { "title": "Tienda", "subtitle": "Descripción", - "cta": "Comprar", - "cta_with_intro_offer": "Comprar", + "call_to_action": "Comprar", + "call_to_action_with_intro_offer": "Comprar", "offer_details": "{{ price_per_month }} cada mes", "offer_details_with_intro_offer": "Comienza tu prueba de {{ intro_duration }}, y después {{ price_per_month }} cada mes" }