From a35a8785454eff38b29176576664ba34c7de2e43 Mon Sep 17 00:00:00 2001 From: Dayo-Akinyemi Date: Sat, 2 Aug 2025 23:04:51 +0100 Subject: [PATCH 1/5] Update Utils.kt --- .../com/mobilepaymentssdkreactnative/Utils.kt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt b/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt index 8d7ee3d..7639d0e 100644 --- a/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt +++ b/android/src/main/java/com/mobilepaymentssdkreactnative/Utils.kt @@ -43,8 +43,10 @@ fun ReadableMap.readPaymentParameters(): PaymentParameters { // Required fields val amountMoney = convertToMoney(getMap("amountMoney")) val processingMode = convertToProcessingMode(getIntOrNull("processingMode")) + val idempotencyKey = getString("idempotencyKey") requireNotNull(amountMoney) { "Amount money is required" } requireNotNull(processingMode) { "processingMode is required" } + requireNotNull(idempotencyKey) { "idempotencyKey is required" } // Optional fields val acceptPartialAuthorization = getBooleanOrNull("acceptPartialAuthorization") @@ -60,10 +62,9 @@ fun ReadableMap.readPaymentParameters(): PaymentParameters { val statementDescription = getString("statementDescription") val teamMemberId = getString("teamMemberId") val tipMoney = convertToMoney(getMap("tipMoney")) - val idempotencyKey = getString("idempotencyKey") val paymentAttemptId = getString("paymentAttemptId") - val builder = PaymentParameters.Builder(amountMoney, processingMode) + val builder = PaymentParameters.Builder(amountMoney,idempotencyKey) acceptPartialAuthorization?.let { builder.acceptPartialAuthorization(it) } appFeeMoney?.let { builder.appFeeMoney(it) } autocomplete?.let { builder.autocomplete(it) } @@ -77,8 +78,6 @@ fun ReadableMap.readPaymentParameters(): PaymentParameters { statementDescription?.let { builder.statementDescription(it) } teamMemberId?.let { builder.teamMemberId(it) } tipMoney?.let { builder.tipMoney(it) } - idempotencyKey?.let { builder.idempotencyKey(it) } - paymentAttemptId?.let { builder.paymentAttemptId(it) } return builder.build() } @@ -330,7 +329,6 @@ fun ReaderInfo.toReaderInfoMap(): WritableMap { putString("id", id) putString("model", model.toModelString()) putString("state", state.toStateString()) - putString("status", status.toStatusString()) putString("serialNumber", serialNumber) putString("name", name) putMap("batteryStatus", batteryStatus?.toBatteryStatusMap()) @@ -380,16 +378,6 @@ fun ReaderInfo.State.toStateString(): String { } } -fun ReaderInfo.Status.toStatusString(): String { - return when (this) { - is ReaderInfo.Status.Ready -> "READY" - is ReaderInfo.Status.ConnectingToDevice -> "CONNECTING_TO_DEVICE" - is ReaderInfo.Status.ConnectingToSquare -> "CONNECTING_TO_SQUARE" - is ReaderInfo.Status.Faulty -> "FAULTY" - is ReaderInfo.Status.ReaderUnavailable -> "READER_UNAVAILABLE_${this.reason.name}" - } -} - fun ReaderChangedEvent.toChangedEventMap(): WritableMap { return WritableNativeMap().apply { From 570a4701130defdbe9b1c6071ccb5a07e5fda4eb Mon Sep 17 00:00:00 2001 From: Dayo-Akinyemi Date: Mon, 4 Aug 2025 20:40:14 +0100 Subject: [PATCH 2/5] Update package.json --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e90ee2c..f5d3b3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "mobile-payments-sdk-react-native", - "version": "2025.6.1", + "name": "square-mobile-payments-sdk-react-native", + "version": "2025.7.4", "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", @@ -54,14 +54,14 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/square/mobile-payments-sdk-react-native.git" + "url": "git+https://github.com/Dayo-Akinyemi/mobile-payments-sdk-react-native.git" }, - "author": "Block, Inc (https://github.com/square/)", + "author": "Ajibola Philip (https://github.com/DayoAkinyemi)", "license": "Apache-2.0", "bugs": { "url": "https://developer.squareup.com/forums/" }, - "homepage": "https://github.com/square/mobile-payments-sdk-react-native#readme", + "homepage": "https://github.com/Dayo-Akinyemi/mobile-payments-sdk-react-native#readme", "publishConfig": { "registry": "https://registry.npmjs.org/" }, From 7e80344c982161c12136de0f4c9c49926b5eca54 Mon Sep 17 00:00:00 2001 From: Dayo-Akinyemi Date: Mon, 4 Aug 2025 20:43:02 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bbadc5b..86dbb1b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # React Native plug-in for Mobile Payments SDK - +# This is an updated version of the mobile payment SDK, the initial one has a bug and i already fixed that [![npm version](https://badge.fury.io/js/mobile-payments-sdk-react-native.svg)](https://badge.fury.io/js/mobile-payments-sdk-react-native) Mobile Payments SDK for React Native supports the following SDK versions: @@ -14,9 +14,9 @@ Before getting started, please review the Requirements and Limitations and Devic ## Installation ```sh -npm install mobile-payments-sdk-react-native +npm install square-mobile-payments-sdk-react-native or -yarn add mobile-payments-sdk-react-native +yarn add square-mobile-payments-sdk-react-native ``` For usage and in-detail documentation, visit our [documentation](docs/) section. From b71bcb99eb798a8871c939b30fb5268309a6dde3 Mon Sep 17 00:00:00 2001 From: Dayo-Akinyemi Date: Mon, 4 Aug 2025 20:45:33 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 86dbb1b..4345612 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# React Native plug-in for Mobile Payments SDK -# This is an updated version of the mobile payment SDK, the initial one has a bug and i already fixed that -[![npm version](https://badge.fury.io/js/mobile-payments-sdk-react-native.svg)](https://badge.fury.io/js/mobile-payments-sdk-react-native) +# React Native plug-in for Mobile Payments SDK Update +## Disclaimer!! +This is a **modified fork** of [`mobile-payments-sdk-react-native`](https://github.com/Dayo-Akinyemi/mobile-payments-sdk-react-native) by [Dayo Akinyemi / Square]. + + [![npm version](https://badge.fury.io/js/mobile-payments-sdk-react-native.svg)](https://badge.fury.io/js/mobile-payments-sdk-react-native) Mobile Payments SDK for React Native supports the following SDK versions: From d4ed7c25179a8f4923fe9c0ad244f0180ee3a89f Mon Sep 17 00:00:00 2001 From: Dayo-Akinyemi Date: Mon, 4 Aug 2025 21:19:02 +0100 Subject: [PATCH 5/5] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5d3b3a..6f535da 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "typecheck": "tsc", "lint": "eslint \"**/*.{js,ts,tsx}\"", "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", - "prepare": "bob build", + "prepare": "npx bob build", "release": "release-it" }, "keywords": [