#negative10xprogrammer
1 messages · Page 1 of 1 (latest)
exactly as in the docs above.
- User inputs card details
- When they click Pay Now, a paymentmethod is supposed to be created
- This should be passed into the endpoint specified in the fetch
all from clicking pay now.
and then i use that paymentmethodId in the backend to both create and confirm intent
and potentially return a clientsecret in case of "requires_action"
Are you setting paymentMethodCreation: 'manual' on the Payment Element? https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=payment#:~:text=paymentMethodCreation%3A 'manual'%2C
not sure how to do that, i barely know any react or js. im a backend developer so im kinda stumbling throuigh the docs just for testing haha
i've basically copy pasted the code up there (and changed to the correct endpoint and request body in the fetch)
How are you creating the Payment Element? Could you share the code please?
so basically just copy pasted step 4 here: https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=payment
<PaymentElement id="payment-element" options={paymentElementOptions} />
you mnean like so?
function App() {
const options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
paymentMethodCreation: 'manual',
// Fully customizable with appearance API.
appearance: {/*...*/},
};
return (
<Elements stripe={stripePromise} options={options}>
<CheckoutForm />
</Elements>
);
};
ahh gotcha, thanks!
Is it working?