You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started using MedusaJS five days ago and created my project with the create-medusa-app CLI tool. According to the documentation, integrating Stripe should work out of the box if the storefront is configured with the API key. However, the "Enter card details" button remained disabled on the checkout page. Investigating the code in src/modules/checkout/components/payment-wrapper/index.tsx, I noticed that my cart object doesn’t have the payment_collection key, so paymentSession is always null.
Expected behavior
The Stripe integration should seamlessly enable me to enter card details and process payment in test mode as outlined in the documentation.
Actual behavior
Despite providing my Stripe API key, the "Enter card details" button is disabled due to the missing payment_collection key, leaving the payment session null and preventing any card entry
Link to reproduction repo
There is no code modification, i only put the NEXT_PUBLIC_STRIPE_KEY
The text was updated successfully, but these errors were encountered:
As I mentioned in my comment on this PR #428, I’ve been investigating the issue and noticed that reverting to the last commit before #427 (commit 8c0c29b) makes the Stripe (in test mode) integration work.
I saw that the cart object in the new version doesn’t have a payment_collection key in my case, which leads to a null paymentSession and at the end disable the following steps of the stripe integration visually disabling the “Enter card details” button. If anyone has insight into this behavior or a workaround, please let me know.
Daumas-hugo
changed the title
[Bug]:
[Bug]: Stripe Integration not working on Payment page
Dec 30, 2024
I think i found why, when we first proceed in the payment workflow if we don't allow user to proceed since the button is disabled.
The button is disabled because cardComplete is false by default and so when we select Stripe we have isStripe true && !cardComplete true so the button is disabled
<Buttonsize="large"className="mt-6"onClick={handleSubmit}isLoading={isLoading}disabled={(isStripe&&!cardComplete)||(!selectedPaymentMethod&&!paidByGiftcard)}data-testid="submit-payment-button">{!activeSession&&isStripeFunc(selectedPaymentMethod)
? " Enter card details"
: "Continue to review"}</Button>
To make it work temporarily i did :
<Buttonsize="large"className="mt-6"onClick={handleSubmit}isLoading={isLoading}disabled={isStripe&&!cardComplete&&!selectedPaymentMethod&&!paidByGiftcard}data-testid="submit-payment-button">{!activeSession&&isStripeFunc(selectedPaymentMethod)
? " Enter card details"
: "Continue to review"}</Button>
Package.json file
Node.js version
v20.15.0
Operating system name and version
Windows 11 Business 23H2
Browser name
Firefox, Google Chrome, Edge
What happended?
I started using MedusaJS five days ago and created my project with the create-medusa-app CLI tool. According to the documentation, integrating Stripe should work out of the box if the storefront is configured with the API key. However, the "Enter card details" button remained disabled on the checkout page. Investigating the code in src/modules/checkout/components/payment-wrapper/index.tsx, I noticed that my cart object doesn’t have the payment_collection key, so paymentSession is always null.
Expected behavior
The Stripe integration should seamlessly enable me to enter card details and process payment in test mode as outlined in the documentation.
Actual behavior
Despite providing my Stripe API key, the "Enter card details" button is disabled due to the missing payment_collection key, leaving the payment session null and preventing any card entry
Link to reproduction repo
There is no code modification, i only put the NEXT_PUBLIC_STRIPE_KEY
The text was updated successfully, but these errors were encountered: