-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MBL-1372: Don't call createToken after ApplePayContext completes #2038
MBL-1372: Don't call createToken after ApplePayContext completes #2038
Conversation
@@ -345,21 +345,27 @@ public class PostCampaignCheckoutViewModel: PostCampaignCheckoutViewModelType, | |||
} | |||
|
|||
let completeCheckoutWithApplePayInput: Signal<GraphAPI.CompleteOnSessionCheckoutInput, Never> = Signal | |||
.combineLatest(newPaymentIntentForApplePay, checkoutId, self.applePayParamsSignal) | |||
.combineLatest(newPaymentIntentForApplePay, checkoutId, self.applePayParamsSignal.mapConst(true)) |
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'm leaving this plumbing here, in case we refactor the mutation to accept the other ApplePay parameters - but mapping it to true
just so it's a little more clear it's unused.
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'm pretty sure we'll never send them (stripe has basic apple pay info that the backend can access) but I'm okay with this approach for now!
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
@@ -345,21 +345,27 @@ public class PostCampaignCheckoutViewModel: PostCampaignCheckoutViewModelType, | |||
} | |||
|
|||
let completeCheckoutWithApplePayInput: Signal<GraphAPI.CompleteOnSessionCheckoutInput, Never> = Signal | |||
.combineLatest(newPaymentIntentForApplePay, checkoutId, self.applePayParamsSignal) | |||
.combineLatest(newPaymentIntentForApplePay, checkoutId, self.applePayParamsSignal.mapConst(true)) |
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'm pretty sure we'll never send them (stripe has basic apple pay info that the backend can access) but I'm okay with this approach for now!
📲 What
Do not create a Stripe token after
ApplePayContext
creates a Stripe PaymentMethod.🤔 Why
In production, this causes Stripe to return an error in the
createToken
endpoint, which breaks our ApplePay flow. Instead, we will ignore thetoken
field andapplePayParams
field in our mutation, treating an ApplePay transaction like a regular credit card transaction.