#Dara - Payment Element

1 messages · Page 1 of 1 (latest)

scenic mango
#

Hello! That's correct, the Payment Element requires a client secret from a Payment Intent or Setup Intent during initialization.

#

The other methods you mentioned, retryInvoiceWithNewPaymentMethod and handlePaymentThatRequiresCustomerAction, sound like methods you created yourself? Or are they from Stripe? Can you provide more details about what you want to do?

woven flare
#

No, those methods were provided in the doc back then. Let me see if i can still find it but i doubt that.

#

I want to migrate to Payment Element to offer more payment methods other than cards but when i review the changes, i dont even have the orignal code as described in the migration doc.

scenic mango
#

Okay, at a high level if you have an Invoice and you want to pay it using the Payment Element you would pass the client secret of the Invoice's Payment Intent to the Payment Element.

#

Does that help?

woven flare
#

Ok, If i remember correctly, I was following the tier-priced subscription doc back then.

#

Not really, the invoice was just a part of the step during subscription integration. I just need to know what to follow for Payment Element from the code I have now or maybe even switch to Checkout...

scenic mango
#

Let's back up. What are you trying to build?

woven flare
scenic mango
#

Gotcha. That guide uses the Card Element. Very little, if any of that code or overall approach would apply to a Payment Element integration.

#

But your overall goal is to allow people to Subscribe and pay with the Payment Element?

woven flare
scenic mango
#

Yep, it's very different for sure!

#

Checkout would be much easier and is recommended if it will fit your use case.

woven flare
#

In the current doc, I don't even see the card element for subscription.

#

2 years ago, Checkout didn't offer tier-priced subscription.

scenic mango
#

Looks like we added support over a year ago now, so you should be all set there.

woven flare
#

Can you confirm if I wanna use Payment Element, i scrap the retryInvoiceWithNewPaymentMethod and handlePaymentThatRequiresCustomerAction, keep the createCustomer, createSubscription and add confirmPayment?

#

And you would recommend Chekcout over Payment Element, right?

#

Oh, i forgot to say there is no code example for payment element in React

scenic mango
#

I would recommend Checkout if it works for you, yes. If you want to build your own integration I recommend scrapping all of the code from before and starting fresh with the guide linked above.

#

Not sure I understand? There was no React version of the previous guide, was there?

woven flare
#

I see. I will provide all the info and make a decision in my team.

#

I think there was. I was following the Next.js doc also and combine different docs to make it work including the Github code exmaple. It took me a great deal bc there were errors on the Stripe doc which I contacted you guys back then. Back then, there wasn't elements.create and card.mount.

obsidian dew
woven flare
#

Between Payment Element and Checkout, which one is a better integration against card testers? Because I was about to add Captcha and rate limit to our website. These frauders are using our website to test cards because we are using Card Elements.

#

True

#

I saw though it's only for Checkout.

obsidian dew
#

gimme a sec to look at this, i'll get back to you

woven flare
#

Ok

obsidian dew
#

generally, as long as you use one of our recommended payment integrations, we have certain controls in place to detect for and mitigate card testing. If you're using the Payment Element then yes, you would want to add Captcha and rate limits to your site as well

woven flare
#

Thanks!