#donziglioni

1 messages · Page 1 of 1 (latest)

acoustic skyBOT
signal birch
tiny sand
#

It's actually getting snagged before the call to my server... Doesn't show in the logs unfortunately.

#

v3:1 Uncaught (in promise) IntegrationError: To use createPaymentMethod with the Payment Element, your elements instance must be created with paymentMethodCreation: 'manual'.
at ge (v3:1:65657)
at e._handleMessage (v3:1:71191)
at e._handleMessage (v3:1:84951)
at v3:1:69094

signal birch
tiny sand
#

I think that points me in the right direction! Thank you!

#

When I click my "Checkout" button, I make a post request to my server which hits paymentIntents.create(). It looks like the paymentMethodCreation is on the "elements.create()" method? Do I need to explicitly create the payment element if I intend to use this method? I can't find anything that says I

#

I'd need to. So That's why I'm confused I think

signal birch
#

Can you share what you're trying to do? Are you going to create a payment method first, then confirm it on a payment intent, or simply just complete a payment?

tiny sand
#

Absolutely! To make it simple, I am using this react template from material UI. https://mui.com/material-ui/getting-started/templates/checkout/

When the checkout opens, it makes a request to create an intent with the order total and generates the client secret.

When clicking next to move to the second page, I am rendering the Payment Element.

From there, I can add a button to submit the transaction. However, there is another "next" button to review the order. So from what I read, I need to create a payment method request? And that is requiring that I set the Payment Element to "manual" when creating the element, however, I am not creating the element, Stripe has the element pre-built and I am not creating a specific "card" element or anything like that.

So my question would be, how can I hold off submitting the confirmation, until the user clicks submit on the following page? Because once I render the review page, the payment element will unmount and no longer be there.

Eeeee, I hope that was clear enough and helps! If not, I'm sure something will pop up soon I hope

MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.

signal birch
#

So from what I read, I need to create a payment method request? And that is requiring that I set the Payment Element to "manual" when creating the element, however, I am not creating the element, Stripe has the element pre-built and I am not creating a specific "card" element or anything like that.
This is not necessary from your flow. Creating a payment method is only required if you would like to do some checks on the payment method before processing the payment.

I'd recommend checking the guide here for payment integration: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements

Securely accept payments online.

acoustic skyBOT