From f08d7245b21726d9c7c9e81723d3c9af9cd2911a Mon Sep 17 00:00:00 2001 From: Nazli Yurdakul <69359432+nazli-stripe@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:31:51 -0500 Subject: [PATCH] Fix surcharge param passing in dev-app and iOS bridge (#853) * dont pass param if empty string * dont check updatePI to set surchargeNotice; --- dev-app/src/screens/CollectCardPaymentScreen.tsx | 2 +- ios/StripeTerminalReactNative.swift | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dev-app/src/screens/CollectCardPaymentScreen.tsx b/dev-app/src/screens/CollectCardPaymentScreen.tsx index 58b02e59..0f6b7169 100644 --- a/dev-app/src/screens/CollectCardPaymentScreen.tsx +++ b/dev-app/src/screens/CollectCardPaymentScreen.tsx @@ -352,7 +352,7 @@ export default function CollectCardPaymentScreen() { updatePaymentIntent: enableUpdatePaymentIntent, enableCustomerCancellation: enableCustomerCancellation, requestDynamicCurrencyConversion: requestDcc, - surchargeNotice: surchargeNotice, + surchargeNotice: surchargeNotice ? surchargeNotice : undefined, }); if (error) { diff --git a/ios/StripeTerminalReactNative.swift b/ios/StripeTerminalReactNative.swift index ad7a2f05..b54e6ea5 100644 --- a/ios/StripeTerminalReactNative.swift +++ b/ios/StripeTerminalReactNative.swift @@ -543,10 +543,7 @@ class StripeTerminalReactNative: RCTEventEmitter, DiscoveryDelegate, BluetoothRe .setUpdatePaymentIntent(updatePaymentIntent) .setEnableCustomerCancellation(enableCustomerCancellation) .setRequestDynamicCurrencyConversion(requestDynamicCurrencyConversion) - - if updatePaymentIntent, let surchargeNoticeValue = surchargeNotice { - collectConfigBuilder.setSurchargeNotice(surchargeNoticeValue) - } + .setSurchargeNotice(surchargeNotice) if let eligibleAmount = params["tipEligibleAmount"] as? Int { do {