Skip to content

Commit

Permalink
Push changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TpayDev committed Sep 16, 2024
1 parent 8b8124f commit bb1f939
Show file tree
Hide file tree
Showing 119 changed files with 44 additions and 2,341 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ function handleResult(result: Result) {
// provided data is invalid
// check error message via result.message
}
if (result instanceof PaymentCreated) {
// payment completed successfully
// read transactionId via result.transactionId
}
if (result instanceof PaymentCompleted) {
// payment completed successfully
// read transactionId via result.transactionId
Expand Down
1 change: 1 addition & 0 deletions android/src/main/java/com/tpay/TpayModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class TpayModule(
val (type, value) = when (tpayResult) {
is TpayResult.ConfigurationSuccess -> CONFIGURATION_SUCCESS to null
is TpayResult.ValidationError -> VALIDATION_ERROR to tpayResult.message
is TpayResult.PaymentCreated -> PAYMENT_CREATED to tpayResult.transactionId
is TpayResult.PaymentCompleted -> PAYMENT_COMPLETED to tpayResult.transactionId
is TpayResult.PaymentCancelled -> PAYMENT_CANCELLED to tpayResult.transactionId
is TpayResult.TokenizationCompleted -> TOKENIZATION_COMPLETED to null
Expand Down
1 change: 1 addition & 0 deletions android/src/main/java/com/tpay/TpayResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.tpay
sealed class TpayResult {
data class ValidationError(val message: String) : TpayResult()
object ConfigurationSuccess : TpayResult()
data class PaymentCreated(val transactionId: String?) : TpayResult()
data class PaymentCompleted(val transactionId: String?) : TpayResult()
data class PaymentCancelled(val transactionId: String?) : TpayResult()
object TokenizationCompleted : TpayResult()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class PaymentDelegateImpl(
private val sheet: ObservablePayment,
private val onResult: (TpayResult) -> Unit
) : PaymentDelegate {
override fun onPaymentCreated(transactionId: String?) {}
override fun onPaymentCreated(transactionId: String?) {
onResult(TpayResult.PaymentCreated(transactionId))
}

override fun onPaymentCompleted(transactionId: String?) {
onResult(TpayResult.PaymentCompleted(transactionId))
Expand Down
1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

92 changes: 0 additions & 92 deletions docs/assets/highlight.css

This file was deleted.

59 changes: 0 additions & 59 deletions docs/assets/main.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/navigation.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/search.js

This file was deleted.

Loading

0 comments on commit bb1f939

Please sign in to comment.