Skip to content
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

Merged
merged 20 commits into from
Mar 29, 2024
Merged

sPOS offline mode support #649

merged 20 commits into from
Mar 29, 2024

Conversation

nazli-stripe
Copy link
Collaborator

@nazli-stripe nazli-stripe commented Mar 27, 2024

Summary

Adds offline mode support for sPOS readers:

  • Updates dev-app to create PIs client-side for sPOS readers
  • Adds offlineDetails to native mappers

Motivation

Testing

image

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@nazli-stripe nazli-stripe force-pushed the nazli/spos-offline branch 2 times, most recently from 6641c1a to b66a50e Compare March 27, 2024 03:43
Copy link
Collaborator

@billfinn-stripe billfinn-stripe left a 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) })
Copy link
Collaborator

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)
Copy link
Collaborator

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!
Copy link
Collaborator

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"
Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove debug log?

@nazli-stripe nazli-stripe merged commit 1bc0c81 into main Mar 29, 2024
2 checks passed
@nazli-stripe nazli-stripe deleted the nazli/spos-offline branch September 7, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants