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

Fix confirmCardPayment in localstripe-v3.js and add an example #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bpcreech
Copy link

@bpcreech bpcreech commented Nov 9, 2024

I wanted to add an example of using localstripe-v3.js, as a way of testing #240 and also because it seems generally useful as documentation.

Along the way I discovered confirmCardPayment isn't quite right; it skips /confirm and goes right to /_authenticate. This fails on cards that don't require 3D Secure authentication because the /_authenticate endpoint is confused about why it's being called at all. I fixed this, modeled on how confirmCardSetup works.

This in turn required a small fix to the localstripe backend to allow calls to /confirm from the browser (i.e., with a client_secret and key as form data).

@bpcreech bpcreech force-pushed the feat/web-sample branch 9 times, most recently from ecef02f to f6b1803 Compare November 10, 2024 00:55
I wanted to add an example of using localstripe-v3.js, as a way of testing
adrienverge#240 and also because it seems
generally useful as documentation.

The example includes a --real-stripe argument so you can quickly compare the
real (test) Stripe API and Stripe.js against localstripe.

Along the way I discovered confirmCardPayment isn't quite right; it skips
/confirm and goes right to /_authenticate. This fails on cards that don't
require 3D Secure authentication because the /_authenticate endpoint is
confused about why it's being called at all. I fixed this, modeled on how
confirmCardSetup works.

This in turn required a small fix to the localstripe backend to allow calls to
/confirm from the browser (i.e., with a client_secret and key as form data).
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.

1 participant