-
Notifications
You must be signed in to change notification settings - Fork 260
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
handle apple pay errors #228
Conversation
@arekkubaczkowski the approach looks good to me, and I works fine for me within the |
ios/StripeSdk.swift
Outdated
@@ -256,8 +256,12 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi | |||
paymentSummaryItems.append(PKPaymentSummaryItem(label: label, amount: amount, type: type)) | |||
} | |||
} | |||
let shippingAddressErrors = Mappers.mapAddressFields(errorAddressFields).map { | |||
PKPaymentRequest.paymentShippingAddressInvalidError(withKey: $0, localizedDescription: $0 + " field error") |
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.
I think we should allow folks to overwrite with their own error message. Maybe we can do
handler: (
summaryItems: ApplePay.CartSummaryItem[],
errorAddressFields?: Array<{ field: ApplePay.AddressFields; message?: string; }>
) => Promise<{
error?: StripeError<ApplePayError>;
}>
Wdyt?
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.
done 👍
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.
LGTM, thanks
resolve #148