-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support offline mode. * update codes. * support ios offline mode * update code * fix iOS delegate codes issues. * update codes. * debug offline mode and update. * update codes. * remove offline mode transaction limit. * debug getOfflineStatus method. * add DatabaseScreen. * fix lint & debug on iOS. * fix lint issue. * fix issues mentioned in the comments. * fix e2e test issue. * update pods * Trigger Build * update pod shas * rebuild detox * delete rebuild * rebuild detox again --------- Co-authored-by: EricLin-BBpos <[email protected]> Co-authored-by: Nazli Yurdakul <[email protected]>
- Loading branch information
1 parent
ce3cb02
commit ffb7cae
Showing
28 changed files
with
2,362 additions
and
2,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
android/src/main/java/com/stripeterminalreactnative/listener/RNOfflineListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.stripeterminalreactnative.listener | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.stripe.stripeterminal.external.OfflineMode | ||
import com.stripe.stripeterminal.external.callable.OfflineListener | ||
import com.stripe.stripeterminal.external.models.OfflineStatus | ||
import com.stripe.stripeterminal.external.models.PaymentIntent | ||
import com.stripe.stripeterminal.external.models.TerminalException | ||
import com.stripeterminalreactnative.ReactExtensions.sendEvent | ||
import com.stripeterminalreactnative.ReactNativeConstants | ||
import com.stripeterminalreactnative.createError | ||
import com.stripeterminalreactnative.mapFromOfflineStatus | ||
import com.stripeterminalreactnative.mapFromPaymentIntent | ||
import com.stripeterminalreactnative.nativeMapOf | ||
|
||
@OptIn(OfflineMode::class) | ||
class RNOfflineListener( | ||
private val context: ReactApplicationContext, | ||
): OfflineListener { | ||
override fun onOfflineStatusChange(offlineStatus: OfflineStatus) { | ||
context.sendEvent(ReactNativeConstants.CHANGE_OFFLINE_STATUS.listenerName) { | ||
putMap("result", mapFromOfflineStatus(offlineStatus)) | ||
} | ||
} | ||
|
||
override fun onPaymentIntentForwarded(paymentIntent: PaymentIntent, e: TerminalException?) { | ||
context.sendEvent(ReactNativeConstants.FORWARD_PAYMENT_INTENT.listenerName) { | ||
putMap("result", mapFromPaymentIntent(paymentIntent, "")) | ||
putMap("error", nativeMapOf { | ||
putString("code", e?.errorCode.toString()) | ||
putString("message", e?.errorMessage) | ||
}) | ||
} | ||
} | ||
|
||
override fun onForwardingFailure(e: TerminalException) { | ||
context.sendEvent(ReactNativeConstants.REPORT_FORWARDING_ERROR.listenerName) { | ||
putMap("result", createError(e)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ export const colors = { | |
slate: '#0A2540', | ||
gray: '#A3B3C1', | ||
red: '#ff3a30', | ||
green: '#00FF00', | ||
}; |
Oops, something went wrong.