Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be making this a required field. I know iOS has a default, but I believe the idea was to make it required. @shauna-kimura thoughts?


// Optional fields
val acceptPartialAuthorization = getBooleanOrNull("acceptPartialAuthorization")
Expand All @@ -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) }
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -266,9 +266,6 @@
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
packageReferences = (
A1682D192CBE92880011933F /* XCRemoteSwiftPackageReference "mobile-payments-sdk-ios" */,
);
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -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 */;
}

This file was deleted.

14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1891,7 +1891,7 @@ SPEC CHECKSUMS:
RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9
RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
SquareMobilePaymentsSDK: 698333088d7200bba3e7991121ba245112390651
SquareMobilePaymentsSDK: f53082b4972428724c629f41882e11e6152c7ec3
Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63

PODFILE CHECKSUM: 81d2f9e3393262e2bc7a99478a8e3a6741f0482e
Expand Down
3 changes: 2 additions & 1 deletion example/src/Screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions mobile-payments-sdk-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
1 change: 1 addition & 0 deletions src/models/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export type PaymentParameters = {
// Required
amountMoney: Money;
processingMode: Number;
allowCardSurcharge?: Boolean; //required for Android

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh does this make it required only for android?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is

// 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/
Expand Down
Loading