-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sPOS offline mode support #649
Conversation
6641c1a
to
b66a50e
Compare
b66a50e
to
58832b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks great! I left a few small nits, but generally looks good to me! Thanks, Nazli!
private fun mapFromAmountDetails(amountDetails: AmountDetails?): ReadableMap? = | ||
amountDetails?.let { | ||
nativeMapOf { | ||
putMap("tip", nativeMapOf { putInt("amount", amountDetails.tip?.amount?.toInt() ?: 0) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we may want putIntOrNull
here because "0" is different from "tip was skipped".
putString("tsi", receiptDetails?.tsi) | ||
putString("tvr", receiptDetails?.tvr) | ||
putString("transactionStatusInformation", receiptDetails?.tsi) | ||
putString("terminalVerificationResult", receiptDetails?.tvr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to add these name changes to a CHANGELOG.
offlinePaymentStatus.sdk.offlinePaymentAmountsByCurrency[ | ||
key | ||
] | ||
offlinePaymentStatus.reader! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be sdk
?
@@ -145,6 +145,8 @@ internal fun mapFromDeviceType(type: DeviceType): String { | |||
DeviceType.WISEPAD_3S -> "wisePad3s" | |||
DeviceType.WISEPOS_E_DEVKIT -> "wisePosEDevkit" | |||
DeviceType.STRIPE_S700_DEVKIT -> "stripeS700Devkit" | |||
DeviceType.STRIPE_S700 -> "stripeS700" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is already covered. Suggest sorting this list alphabetically to make dupes easier to find.
@@ -165,6 +165,7 @@ export default function CollectCardPaymentScreen() { | |||
}; | |||
let paymentIntent: PaymentIntent.Type | undefined; | |||
let paymentIntentError: StripeError<CommonError> | undefined; | |||
console.log(deviceType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove debug log?
Summary
Adds offline mode support for sPOS readers:
Motivation
Testing
Documentation
Select one: