From e6a00982af990cb596ba02e0c2f6b49b9fcd4983 Mon Sep 17 00:00:00 2001 From: Cesar Sosa <101717495+cesar-sosa-hol@users.noreply.github.com> Date: Tue, 18 Nov 2025 00:43:19 +0100 Subject: [PATCH] upgrade native SDKs --- .../com/mobilepaymentssdkreactnative/Utils.kt | 3 ++- example/android/build.gradle | 2 +- .../project.pbxproj | 16 +--------------- .../xcshareddata/swiftpm/Package.resolved | 15 --------------- example/ios/Podfile.lock | 14 +++++++------- example/src/Screens/HomeScreen.tsx | 3 ++- ios/Podfile | 2 +- ios/Podfile.lock | 8 ++++---- mobile-payments-sdk-react-native.podspec | 4 ++-- src/models/objects.ts | 1 + 10 files changed, 21 insertions(+), 47 deletions(-) delete mode 100644 example/ios/MobilePaymentsSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt b/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt index ecaa12c..227dbe8 100644 --- a/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt +++ b/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt @@ -45,6 +45,7 @@ fun ReadableMap.readPaymentParameters(): PaymentParameters { val processingMode = convertToProcessingMode(getIntOrNull("processingMode")) requireNotNull(amountMoney) { "Amount money is required" } requireNotNull(processingMode) { "processingMode is required" } + val allowCardSurcharge = getBooleanOrNull("allowCardSurcharge") ?: false // Optional fields val acceptPartialAuthorization = getBooleanOrNull("acceptPartialAuthorization") @@ -63,7 +64,7 @@ fun ReadableMap.readPaymentParameters(): PaymentParameters { val idempotencyKey = getString("idempotencyKey") val paymentAttemptId = getString("paymentAttemptId") - val builder = PaymentParameters.Builder(amountMoney, processingMode) + val builder = PaymentParameters.Builder(amountMoney, processingMode, allowCardSurcharge) acceptPartialAuthorization?.let { builder.acceptPartialAuthorization(it) } appFeeMoney?.let { builder.appFeeMoney(it) } autocomplete?.let { builder.autocomplete(it) } diff --git a/example/android/build.gradle b/example/android/build.gradle index 13efb9a..39e2407 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { targetSdkVersion = 35 ndkVersion = "26.1.10909125" kotlinVersion = "2.0.21" - squareSdkVersion = "2.3.1" + squareSdkVersion = "2.3.4" } repositories { google() diff --git a/example/ios/MobilePaymentsSdkReactNativeExample.xcodeproj/project.pbxproj b/example/ios/MobilePaymentsSdkReactNativeExample.xcodeproj/project.pbxproj index 6be7ce0..0b5cc7d 100644 --- a/example/ios/MobilePaymentsSdkReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/MobilePaymentsSdkReactNativeExample.xcodeproj/project.pbxproj @@ -227,8 +227,8 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - A1682D1A2CBE9B6C0011933F /* ShellScript */, F0C06FCD06EEF84EA2F24865 /* [CP] Embed Pods Frameworks */, + A1682D1A2CBE9B6C0011933F /* ShellScript */, 6946B4FEF2A06271C5A3F199 /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -266,9 +266,6 @@ Base, ); mainGroup = 83CBB9F61A601CBA00E9B192; - packageReferences = ( - A1682D192CBE92880011933F /* XCRemoteSwiftPackageReference "mobile-payments-sdk-ios" */, - ); productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -782,17 +779,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - A1682D192CBE92880011933F /* XCRemoteSwiftPackageReference "mobile-payments-sdk-ios" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/square/mobile-payments-sdk-ios"; - requirement = { - branch = main; - kind = branch; - }; - }; -/* End XCRemoteSwiftPackageReference section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; } diff --git a/example/ios/MobilePaymentsSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/MobilePaymentsSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index b810429..0000000 --- a/example/ios/MobilePaymentsSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,15 +0,0 @@ -{ - "originHash" : "9ba5bf9b6f630a6dffe060602219b27b9ee75c935dd982c73df381742de27451", - "pins" : [ - { - "identity" : "mobile-payments-sdk-ios", - "kind" : "remoteSourceControl", - "location" : "https://github.com/square/mobile-payments-sdk-ios", - "state" : { - "branch" : "main", - "revision" : "5d23e394188d44a8d48d4ab723cd183d58abdf74" - } - } - ], - "version" : 3 -} diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a2cab6c..1dacb30 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -11,7 +11,7 @@ PODS: - DoubleConversion - glog - hermes-engine - - MockReaderUI (~> 2.2.3) + - MockReaderUI (~> 2.3.1) - RCT-Folly (= 2024.01.01.00) - RCTRequired - RCTTypeSafety @@ -28,9 +28,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - SquareMobilePaymentsSDK (~> 2.2.3) + - SquareMobilePaymentsSDK (~> 2.3.1) - Yoga - - MockReaderUI (2.2.3) + - MockReaderUI (2.3.1) - Permission-BluetoothPeripheral (3.10.1): - RNPermissions - Permission-LocationAccuracy (3.10.1): @@ -1581,7 +1581,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - SocketRocket (0.7.0) - - SquareMobilePaymentsSDK (2.2.3) + - SquareMobilePaymentsSDK (2.3.1) - Yoga (0.0.0) DEPENDENCIES: @@ -1823,8 +1823,8 @@ SPEC CHECKSUMS: fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: 69ef571f3de08433d766d614c73a9838a06bf7eb hermes-engine: 8d2103d6c0176779aea4e25df6bb1410f9946680 - mobile-payments-sdk-react-native: 0be0073bdd89d600b12420a93f2e4cd0a1cba80a - MockReaderUI: d88d35cb4926b38425c2ba9fa3ef11a4aaf39f21 + mobile-payments-sdk-react-native: 14d13486a0252d5a56cd6b1bfbd2e2f10c26b11a + MockReaderUI: 9307e00522d5ff4aa6fb5c012205af1bbab7dc70 Permission-BluetoothPeripheral: 34ab829f159c6cf400c57bac05f5ba1b0af7a86e Permission-LocationAccuracy: 30c5421911024b28d8916db5cbd728097da54434 Permission-LocationAlways: af165dee8a5a5888df6764f9f6ba98b112893709 @@ -1891,7 +1891,7 @@ SPEC CHECKSUMS: RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - SquareMobilePaymentsSDK: 698333088d7200bba3e7991121ba245112390651 + SquareMobilePaymentsSDK: f53082b4972428724c629f41882e11e6152c7ec3 Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63 PODFILE CHECKSUM: 81d2f9e3393262e2bc7a99478a8e3a6741f0482e diff --git a/example/src/Screens/HomeScreen.tsx b/example/src/Screens/HomeScreen.tsx index 43291ad..b31a6f1 100644 --- a/example/src/Screens/HomeScreen.tsx +++ b/example/src/Screens/HomeScreen.tsx @@ -49,9 +49,10 @@ const HomeView = () => { const paymentParameters: PaymentParameters = { amountMoney: { amount: 1, currencyCode: CurrencyCode.EUR }, appFeeMoney: { amount: 0, currencyCode: CurrencyCode.EUR }, + allowCardSurcharge: false, paymentAttemptId: uuid.v4(), note: 'Payment for services', - processingMode: ProcessingMode.ONLINE_ONLY + processingMode: ProcessingMode.ONLINE_ONLY, // Other parameters you could add: // autocomplete: true, // delayAction: DelayAction.CANCEL, diff --git a/ios/Podfile b/ios/Podfile index d80adf4..577e102 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -7,7 +7,7 @@ target 'RNMobilePaymentSDK' do use_frameworks! # Pods for RNMobilePaymentSDK - pod "SquareMobilePaymentsSDK", "~> 2.3.0" + pod "SquareMobilePaymentsSDK", "~> 2.3.1" target 'RNMobilePaymentSDKTests' do inherit! :search_paths # Pods for testing diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d272b2e..512a7dd 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,16 +1,16 @@ PODS: - - SquareMobilePaymentsSDK (2.3.0) + - SquareMobilePaymentsSDK (2.3.1) DEPENDENCIES: - - SquareMobilePaymentsSDK (~> 2.3.0) + - SquareMobilePaymentsSDK (~> 2.3.1) SPEC REPOS: trunk: - SquareMobilePaymentsSDK SPEC CHECKSUMS: - SquareMobilePaymentsSDK: c03d0e848b113e1b0f8232906edfeef0431b12a5 + SquareMobilePaymentsSDK: f53082b4972428724c629f41882e11e6152c7ec3 -PODFILE CHECKSUM: 7fcda1369bcf901a993048ddfbd46299640d69fd +PODFILE CHECKSUM: 234882d7834790af146a9dbf17b3c978fb017aae COCOAPODS: 1.16.2 diff --git a/mobile-payments-sdk-react-native.podspec b/mobile-payments-sdk-react-native.podspec index eb05892..49df639 100644 --- a/mobile-payments-sdk-react-native.podspec +++ b/mobile-payments-sdk-react-native.podspec @@ -14,8 +14,8 @@ Pod::Spec.new do |s| s.platforms = { :ios => "16" } s.source = { :git => "https://github.com/square//mobile-payments-sdk-react-native.git", :tag => "#{s.version}" } - s.dependency "MockReaderUI", "~> 2.3.0" - s.dependency "SquareMobilePaymentsSDK", "~> 2.3.0" + s.dependency "MockReaderUI", "~> 2.3.1" + s.dependency "SquareMobilePaymentsSDK", "~> 2.3.1" s.source_files = "ios/**/*.{h,m,mm,swift}" diff --git a/src/models/objects.ts b/src/models/objects.ts index 0aaa51c..211010c 100644 --- a/src/models/objects.ts +++ b/src/models/objects.ts @@ -74,6 +74,7 @@ export type PaymentParameters = { // Required amountMoney: Money; processingMode: Number; + allowCardSurcharge?: Boolean; //required for Android // Optional. For defaults, check: // Android: https://square.github.io/mobile-payments-sdk-android/-mobile%20-payments%20-s-d-k%20-android%20-technical%20-reference/com.squareup.sdk.mobilepayments.payment/-payment-parameters/index.html // iOS: https://square.github.io/mobile-payments-sdk-ios/docs/documentation/mobilepaymentssdkapi/paymentparameters/