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

MBL-1372: Don't call createToken after ApplePayContext completes #2038

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

amy-at-kickstarter
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter commented Apr 17, 2024

📲 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 the token field and applePayParams field in our mutation, treating an ApplePay transaction like a regular credit card transaction.

@@ -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))
Copy link
Contributor Author

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.

Copy link
Contributor

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!

@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review April 17, 2024 13:44
Copy link
Contributor

@scottkicks scottkicks left a 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))
Copy link
Contributor

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!

@amy-at-kickstarter amy-at-kickstarter merged commit b2ff7ba into main Apr 17, 2024
4 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the bug/adyer/MBL-1372/applepay-late-pledges branch April 17, 2024 17:17
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