Skip to content

Commit

Permalink
RMET-3390 - Payments Plugin - Use @SerializableName annotation to avo…
Browse files Browse the repository at this point in the history
…id issues with code obfuscation (#50) (#51)

* chore: update lib to test version

References: https://outsystemsrd.atlassian.net/browse/RMET-3390

* chore: update changelog

References: https://outsystemsrd.atlassian.net/browse/RMET-3390

* chore: update lib dependency to test

* Revert "chore: update lib dependency to test"

This reverts commit b42d5a0.

* fix: remove usage of `runBlocking

References: https://outsystemsrd.atlassian.net/browse/RMET-3390

* chore: set lib version to test

* chore: set dependency version to release

References: https://outsystemsrd.atlassian.net/browse/RMET-3390
  • Loading branch information
alexgerardojacinto committed Aug 28, 2024
1 parent da25544 commit 635521b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

The changes documented here do not include those from the original repository.

## 1.2.2

### Fixes
- Fix: Update dependency to `OSPaymentsLib-Android` that adds `@SerializableName` annotation to avoid issues when using code obfuscation (https://outsystemsrd.atlassian.net/browse/RMET-3387).

## 1.2.1

### Fixes
Expand Down
26 changes: 11 additions & 15 deletions src/android/com/outsystems/payments/OSPayments.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.outsystems.plugins.payments.model.OSPMTError
import com.outsystems.plugins.payments.model.PaymentConfigurationInfo
import com.outsystems.plugins.payments.model.PaymentDetails
import com.outsystems.plugins.payments.model.Tokenization
import kotlinx.coroutines.runBlocking
import org.apache.cordova.CallbackContext
import org.apache.cordova.CordovaInterface
import org.apache.cordova.CordovaWebView
Expand Down Expand Up @@ -55,22 +54,19 @@ class OSPayments : CordovaImplementation() {

override fun execute(action: String, args: JSONArray, callbackContext: CallbackContext): Boolean {
this.callbackContext = callbackContext
val result = runBlocking {
when (action) {
"setupConfiguration" -> {
setupConfiguration(args)
}
"checkWalletSetup" -> {
checkWalletSetup()
}
"setDetails" -> {
setDetailsAndTriggerPayment(args)
}
else -> false
when (action) {
"setupConfiguration" -> {
setupConfiguration(args)
}
true
"checkWalletSetup" -> {
checkWalletSetup()
}
"setDetails" -> {
setDetailsAndTriggerPayment(args)
}
else -> return false
}
return result
return true
}

private fun setupConfiguration(args: JSONArray) {
Expand Down
2 changes: 1 addition & 1 deletion src/android/com/outsystems/payments/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ apply plugin: 'kotlin-kapt'
dependencies {
implementation("com.github.outsystems:oscore-android:1.2.0@aar")
implementation("com.github.outsystems:oscordova-android:2.0.1@aar")
implementation("com.github.outsystems:ospayments-android:1.1.0@aar")
implementation("com.github.outsystems:ospayments-android:1.1.1@aar")

implementation 'com.stripe:stripe-android:20.5.0'

Expand Down

0 comments on commit 635521b

Please sign in to comment.