From a9ec3d3ac1e7c105f2a33f5d91f33be65d334779 Mon Sep 17 00:00:00 2001 From: Praful Koppalkar Date: Mon, 4 Sep 2023 22:24:53 +0530 Subject: [PATCH 1/2] Added a check for prod key removed warning for disableSavedCard prop --- src/Types/PaymentType.res | 1 + src/orca-loader/Hyper.res | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Types/PaymentType.res b/src/Types/PaymentType.res index 07c094cab..eb1cfa7b3 100644 --- a/src/Types/PaymentType.res +++ b/src/Types/PaymentType.res @@ -806,6 +806,7 @@ let itemToObjMapper = (dict, logger) => { "terms", "wallets", "showCardFormByDefault", + "disableSaveCards", ], dict, "options", diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index 20e2b7554..aa1b8d7be 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -91,7 +91,11 @@ let make = (publishableKey, _options: option, analyticsInfo: optionJs.String2.startsWith("pk_snd_")) { + if ( + publishableKey == "" || + (!(publishableKey->Js.String2.startsWith("pk_snd_")) || + !(publishableKey->Js.String2.startsWith("pk_prd_"))) + ) { manageErrorWarning(INVALID_PK, (), ~logger) } if ( From 7fecd79ad4d950ee07d1a29466e92e2e5465d73c Mon Sep 17 00:00:00 2001 From: Praful Koppalkar Date: Fri, 8 Sep 2023 15:52:22 +0530 Subject: [PATCH 2/2] changed the pub key check logic --- src/orca-loader/Hyper.res | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index aa1b8d7be..abe8140f7 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -93,8 +93,10 @@ let make = (publishableKey, _options: option, analyticsInfo: optionJs.String2.startsWith("pk_snd_")) || - !(publishableKey->Js.String2.startsWith("pk_prd_"))) + !( + publishableKey->Js.String2.startsWith("pk_snd_") || + publishableKey->Js.String2.startsWith("pk_prd_") + ) ) { manageErrorWarning(INVALID_PK, (), ~logger) }