From 5896b0cd53eefadfbd4c449a52bf2cc5ad401ceb Mon Sep 17 00:00:00 2001 From: Riddhiagrawal001 <50551695+Riddhiagrawal001@users.noreply.github.com> Date: Thu, 25 Jul 2024 18:55:57 +0530 Subject: [PATCH] chore: Apple pay extra step addition (#1047) Co-authored-by: Pritish Budhiraja --- .../ApplePay/ApplePayIntegrationHelper.res | 80 +++++++++++++++++++ .../ApplePay/ApplePaySimplifiedFlow.res | 10 +++ .../ConnectorUIUtils/PaymentMethod.res | 1 + .../ComplianceCertificates/Compliance.res | 11 ++- 4 files changed, 99 insertions(+), 3 deletions(-) diff --git a/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePayIntegrationHelper.res b/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePayIntegrationHelper.res index 0caa7af2f..bec7604b5 100644 --- a/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePayIntegrationHelper.res +++ b/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePayIntegrationHelper.res @@ -49,6 +49,86 @@ module HostURL = { } } +module SampleEmail = { + @react.component + let make = () => { + let showToast = ToastState.useShowToast() + + let (isTextVisible, setIsTextVisible) = React.useState(_ => false) + + let businessDescription = ". The business operates across countries and has customers across the world." + let featureReqText = "We are using Hyperswitch, a Level 1 PCI DSS 3.2.1 compliant Payments Orchestrator, to manage payments on our website. In addition to Stripe, since we are using other processors as well to process payments across multiple geographies, we wanted to use Hyperswitch's Payment Processing certificate to decrypt Apple pay tokens and send the decrypted Apple pay tokens to Stripe. So, please enable processing decrypted Apple pay token feature on our Stripe account. We've attached Hyperswitch's PCI DSS AoC for reference." + + let emailContent = `Stripe Account id: + + A detailed business description: + ${businessDescription} + + Feature Request: + ${featureReqText}` + + let truncatedText = isTextVisible + ? featureReqText + : featureReqText->String.slice(~start=0, ~end=50) + + let truncatedTextElement = +

+ {truncatedText->React.string} +

setIsTextVisible(_ => true)}> + {"..."->React.string} +

+

+ +
+ + + {"Since the Apple Pay Web Domain flow involves decryption at Hyperswitch, you would need to write to Stripe support (support@stripe.com) to get this feature enabled for your Stripe account. You can use the following text in the email, attach our"->React.string} + + + {"PCI DSS AoC certificate"->React.string} + + + {"and copy our Support team (biz@hyperswitch.io):"->React.string} + + +
+
+ + {"Stripe Account id: React.string} + + {"here"->React.string} + + {">"->React.string} + + +

{"A detailed business description:"->React.string}

+ {businessDescription->React.string} +
+ +

{"Feature Request:"->React.string}

+ {isTextVisible ? truncatedText->React.string : truncatedTextElement} +
+
+ { + Clipboard.writeText(emailContent) + showToast(~message="Copied to Clipboard!", ~toastType=ToastSuccess, ()) + }} + /> +
+
+ } +} + module CustomTag = { @react.component let make = (~tagText="", ~tagSize=5, ~tagLeftIcon=None, ~tagCustomStyle="") => { diff --git a/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePaySimplifiedFlow.res b/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePaySimplifiedFlow.res index 9927f2b20..e9e1a81e6 100644 --- a/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePaySimplifiedFlow.res +++ b/src/screens/Connectors/ConnectorMetaData/ApplePay/ApplePaySimplifiedFlow.res @@ -23,6 +23,7 @@ let make = ( let formState: ReactFinalForm.formState = ReactFinalForm.useFormState( ReactFinalForm.useFormSubscription(["values"])->Nullable.make, ) + let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let initalFormValue = formState.values ->getDictFromJsonObject @@ -158,6 +159,15 @@ let make = ( )}`} />} /> + +
+ } + /> +