Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/RMET-3990/use-serializable-a…
Browse files Browse the repository at this point in the history
…nnotation' into fix/RMET-3390/use-serializable-annotation
  • Loading branch information
alexgerardojacinto committed Aug 27, 2024
2 parents c5ece4a + 0508154 commit 60e47b7
Showing 1 changed file with 11 additions and 15 deletions.
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

0 comments on commit 60e47b7

Please sign in to comment.