Skip to content

Commit

Permalink
RMET-2993 Payments Plugin - Fix dependencies and update code accordin…
Browse files Browse the repository at this point in the history
…gly (#31)

* 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

* chore: update changelog

References: https://outsystemsrd.atlassian.net/browse/RMET-2993
  • Loading branch information
alexgerardojacinto authored and OS-ricardomoreirasilva committed Apr 10, 2024
1 parent 5fb0429 commit c51eb3b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
18 changes: 10 additions & 8 deletions src/android/com/outsystems/payments/OSPayments.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/android/com/outsystems/payments/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c51eb3b

Please sign in to comment.