From 4edfc02e0dc0538632172598560a74ac23dc8460 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Thu, 21 Dec 2023 18:14:55 +0000 Subject: [PATCH 1/2] fix: update dependencies and update code accordingly Context: When using the Payments plugin in an app containing another plugin, if that other plugin was already pointing to more recent versions of oscore-android and oscordova-android, the build would fail because those more recent versions would be used, and the code in OSPayments.kt wasn't compatible with them. References: https://outsystemsrd.atlassian.net/browse/RMET-2993 --- .../com/outsystems/payments/OSPayments.kt | 18 ++++++++++-------- .../com/outsystems/payments/build.gradle | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/android/com/outsystems/payments/OSPayments.kt b/src/android/com/outsystems/payments/OSPayments.kt index a4a812d..bb83904 100644 --- a/src/android/com/outsystems/payments/OSPayments.kt +++ b/src/android/com/outsystems/payments/OSPayments.kt @@ -107,15 +107,17 @@ class OSPayments : CordovaImplementation() { } } - override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) { + override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) { super.onActivityResult(requestCode, resultCode, intent) - paymentsController.handleActivityResult(requestCode, resultCode, intent, - { paymentResponse -> - sendPluginResult(paymentResponse, null) - }, - { error -> - sendPluginResult(null, Pair(formatErrorCode(error.code), error.description)) - }) + if (intent != null) { + paymentsController.handleActivityResult(requestCode, resultCode, intent, + { paymentResponse -> + sendPluginResult(paymentResponse, null) + }, + { error -> + sendPluginResult(null, Pair(formatErrorCode(error.code), error.description)) + }) + } } override fun onRequestPermissionResult(requestCode: Int, diff --git a/src/android/com/outsystems/payments/build.gradle b/src/android/com/outsystems/payments/build.gradle index 38316d4..d0d6d85 100644 --- a/src/android/com/outsystems/payments/build.gradle +++ b/src/android/com/outsystems/payments/build.gradle @@ -27,8 +27,8 @@ repositories{ apply plugin: 'kotlin-kapt' dependencies { - implementation("com.github.outsystems:oscore-android:1.1.0@aar") - implementation("com.github.outsystems:oscordova-android:1.1.0@aar") + implementation("com.github.outsystems:oscore-android:1.2.0@aar") + implementation("com.github.outsystems:oscordova-android:2.0.0@aar") implementation("com.github.outsystems:ospayments-android:1.1.0@aar") implementation 'com.stripe:stripe-android:20.5.0' From 119d27966490a04f5cdfafab92a68e71aee851cf Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Thu, 21 Dec 2023 18:42:05 +0000 Subject: [PATCH 2/2] chore: update changelog References: https://outsystemsrd.atlassian.net/browse/RMET-2993 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1e7cb6..5fefb1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The changes documented here do not include those from the original repository. ## [Unreleased] +### 21-12-2023 +- Fix: [Android] Updates dependency to OSCore and OSCordova (https://outsystemsrd.atlassian.net/browse/RMET-2993). + ### 03-10-2023 - Fix: [iOS] Fixes path, removing duplicate string (https://outsystemsrd.atlassian.net/browse/RMET-2855).