#krustyflakes-paymentelement
1 messages ยท Page 1 of 1 (latest)
Hello, I already turned on a few payment options using the dashboard, my understanding is that if those are enabled once i get my secret and instantiate the PaymentSheet the "choose a payment method" should be automatically populated
i'm trying to figure out is this is a correct assumption and if theres anything else our backend or client should do for them to be presented
An important step that you haven't mentioned is that when you create the Payment Intent you also need to set automatic_payment_methods.enabled: true (see https://stripe.com/docs/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i was just seeing that example
intent = Stripe::PaymentIntent.create({
amount: 1099,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
})
in the migration guide, ok so we need to add this automatic_payment_methods
Yup, you'd need to add that if you want to have the payment method types pulled from your dashboard settings
I just spoke to our BE engineer I shared with them the need to use automatic_payment_methods and they said they can't see this property, im guessing we are running an older version?
It should be available on all API versions, but are you maybe using a strongly typed language? If you're using an older version of one of server-side libraries that would explain it
And this is something recent
Yeah, this is something that was added in the past few months - if you give me more details on which library you're using I can point to when it was added
thank you
i think im clear now of what needs to be updated and what the client should expect moving forward
๐ great!
if we weren't able to update just now
is there a workaround we could do so that native engineers could start testing the integration?
Hmmm... you could generate some one-off Payment Intents using curl or the CLI just to be used to see how the Payment Element will display them
There isn't really an end-to-end guide - you can see an example of how to format the curl request here (https://stripe.com/docs/api/payment_intents/create?lang=curl, you'll need to pass in some additional parameters since the example is just doing the basics), and then you'd use that client secret in your client-side code instead of having your backend generate a new PI
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thank you
I'm gonna head out soon, but if you have any other questions @solemn arch can help!