-
Notifications
You must be signed in to change notification settings - Fork 6
upgrade to 2.5.0 native sdk #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,15 +292,10 @@ private fun Card.Brand.toBrandString(): String = | |
| Card.Brand.JCB -> "JCB" | ||
| Card.Brand.CHINA_UNIONPAY -> "CHINA_UNIONPAY" | ||
| Card.Brand.SQUARE_GIFT_CARD -> "SQUARE_GIFT_CARD" | ||
| Card.Brand.ALIPAY -> "ALIPAY" | ||
| Card.Brand.CASH_APP -> "CASH_APP" | ||
| Card.Brand.EFTPOS -> "EFTPOS" | ||
| Card.Brand.FELICA -> "FELICA" | ||
| Card.Brand.INTERAC -> "INTERAC" | ||
| Card.Brand.SQUARE_CAPITAL_CARD -> "SQUARE_CAPITAL_CARD" | ||
| Card.Brand.SUICA -> "SUICA" | ||
| Card.Brand.ID -> "ID" | ||
| Card.Brand.QUICPAY -> "QUICPAY" | ||
| } | ||
|
|
||
| private fun Card.CoBrand.toCoBrandString(): String = | ||
|
|
@@ -356,8 +351,10 @@ fun ReaderInfo.toReaderInfoMap(): WritableMap { | |
| putString("serialNumber", serialNumber) | ||
| putString("name", name) | ||
| putMap("batteryStatus", batteryStatus?.toBatteryStatusMap()) | ||
| putString("firmwareVersion", firmwareVersion) | ||
| putInt("firmwarePercent", firmwarePercent ?: 0) | ||
| putMap( | ||
| "firmwareInfo", | ||
| firmwareInfo.toFirmwareInfoMap() | ||
| ) | ||
| putArray("supportedCardEntryMethods", WritableNativeArray().apply { | ||
| supportedCardEntryMethods.forEach { | ||
| pushString(it.toEntryMethodString()) | ||
|
|
@@ -368,6 +365,21 @@ fun ReaderInfo.toReaderInfoMap(): WritableMap { | |
| } | ||
| } | ||
|
|
||
| fun ReaderInfo.ReaderFirmwareInfo.toFirmwareInfoMap(): WritableMap { | ||
| return WritableNativeMap().apply { | ||
| putString("version", version) | ||
| putInt("updatePercentage", updateStatus.toPercent() ?: 0) | ||
| } | ||
| } | ||
|
|
||
| fun ReaderInfo.FirmwareUpdateStatus.toPercent() : Int? { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: extra whitespace after
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| return when(this) { | ||
| is ReaderInfo.FirmwareUpdateStatus.None -> null | ||
| is ReaderInfo.FirmwareUpdateStatus.InProgress -> this.updatePercentage | ||
| is ReaderInfo.FirmwareUpdateStatus.Pending -> null | ||
| } | ||
| } | ||
|
|
||
| fun CardEntryMethod.toEntryMethodString(): String { | ||
| return when(this) { | ||
| CardEntryMethod.EMV -> "EMV" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,11 +7,11 @@ PODS: | |
| - hermes-engine (0.75.3): | ||
| - hermes-engine/Pre-built (= 0.75.3) | ||
| - hermes-engine/Pre-built (0.75.3) | ||
| - mobile-payments-sdk-react-native (2026.2.1): | ||
| - mobile-payments-sdk-react-native (2026.3.4): | ||
| - DoubleConversion | ||
| - glog | ||
| - hermes-engine | ||
| - MockReaderUI (~> 2.4.0) | ||
| - MockReaderUI (~> 2.5.0) | ||
| - RCT-Folly (= 2024.01.01.00) | ||
| - RCTRequired | ||
| - RCTTypeSafety | ||
|
|
@@ -28,9 +28,9 @@ PODS: | |
| - ReactCodegen | ||
| - ReactCommon/turbomodule/bridging | ||
| - ReactCommon/turbomodule/core | ||
| - SquareMobilePaymentsSDK (~> 2.4.0) | ||
| - SquareMobilePaymentsSDK (~> 2.5.0) | ||
| - Yoga | ||
| - MockReaderUI (2.4.0) | ||
| - MockReaderUI (2.5.0) | ||
| - 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.4.0) | ||
| - SquareMobilePaymentsSDK (2.5.0) | ||
| - Yoga (0.0.0) | ||
|
|
||
| DEPENDENCIES: | ||
|
|
@@ -1823,8 +1823,8 @@ SPEC CHECKSUMS: | |
| fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 | ||
| glog: 69ef571f3de08433d766d614c73a9838a06bf7eb | ||
| hermes-engine: 8d2103d6c0176779aea4e25df6bb1410f9946680 | ||
| mobile-payments-sdk-react-native: 161fbdf5a7a5cd788224a78d361c08c5d2a3fb8c | ||
| MockReaderUI: e527a5bc446b95e8cd5ddb4c565fc7d614d38a0f | ||
| mobile-payments-sdk-react-native: b32d25a22d460063b2c705d86740998613d10e3e | ||
| MockReaderUI: 651252bf60bffc2699866448a6fb7250c06be785 | ||
| Permission-BluetoothPeripheral: 34ab829f159c6cf400c57bac05f5ba1b0af7a86e | ||
| Permission-LocationAccuracy: 30c5421911024b28d8916db5cbd728097da54434 | ||
| Permission-LocationAlways: af165dee8a5a5888df6764f9f6ba98b112893709 | ||
|
|
@@ -1891,7 +1891,7 @@ SPEC CHECKSUMS: | |
| RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 | ||
| RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 | ||
| SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d | ||
| SquareMobilePaymentsSDK: 53cd315a537037377cd364edc874bf75782239eb | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validated these hashes - they are the sha1sum of the podspec: $ # For local/path pods, CocoaPods uses Specification#checksum which does:
# Digest::SHA1.hexdigest(File.read(defined_in_file))
echo "=== Trunk pod verification ==="
echo "SquareMobilePaymentsSDK 2.5.0:"
echo " Podfile.lock says: 61d783cb2ef4b238731f4433a42028d95c77893c"
echo " pod spec cat hash: $(pod spec cat SquareMobilePaymentsSDK --version=2.5.0 2>/dev/null | shasum -a 1 | awk '{print
$1}')"
echo ""
echo "MockReaderUI 2.5.0:"
echo " Podfile.lock says: 651252bf60bffc2699866448a6fb7250c06be785"
echo " pod spec cat hash: $(pod spec cat MockReaderUI --version=2.5.0 2>/dev/null | shasum -a 1 | awk '{print $1}')"
=== Trunk pod verification ===
SquareMobilePaymentsSDK 2.5.0:
Podfile.lock says: 61d783cb2ef4b238731f4433a42028d95c77893c
pod spec cat hash: 61d783cb2ef4b238731f4433a42028d95c77893c
MockReaderUI 2.5.0:
Podfile.lock says: 651252bf60bffc2699866448a6fb7250c06be785
pod spec cat hash: 651252bf60bffc2699866448a6fb7250c06be785 |
||
| SquareMobilePaymentsSDK: 61d783cb2ef4b238731f4433a42028d95c77893c | ||
| Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63 | ||
|
|
||
| PODFILE CHECKSUM: 81d2f9e3393262e2bc7a99478a8e3a6741f0482e | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| PODS: | ||
| - SquareMobilePaymentsSDK (2.4.0) | ||
| - SquareMobilePaymentsSDK (2.5.0) | ||
|
|
||
| DEPENDENCIES: | ||
| - SquareMobilePaymentsSDK (~> 2.4.0) | ||
| - SquareMobilePaymentsSDK (~> 2.5.0) | ||
|
|
||
| SPEC REPOS: | ||
| trunk: | ||
| - SquareMobilePaymentsSDK | ||
|
|
||
| SPEC CHECKSUMS: | ||
| SquareMobilePaymentsSDK: 53cd315a537037377cd364edc874bf75782239eb | ||
| SquareMobilePaymentsSDK: 61d783cb2ef4b238731f4433a42028d95c77893c | ||
|
|
||
| PODFILE CHECKSUM: 90edd7b3e424a600173ffd8b1fcb677878cc582e | ||
| PODFILE CHECKSUM: b2206f603fba9bc930b94625386c4dfad56fed65 | ||
|
|
||
| COCOAPODS: 1.16.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "mobile-payments-sdk-react-native", | ||
| "version": "2026.3.4", | ||
| "version": "2026.4.1", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new entry to the https://github.com/square/mobile-payments-sdk-react-native/blob/main/CHANGELOG.md
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added new line in changelog |
||
| "description": "Mobile Payments SDK plug-in for React Native. Enables developers to build secure in-person payment solutions.", | ||
| "source": "./src/index.tsx", | ||
| "main": "./lib/commonjs/index.js", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.