#boehmi1337_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1219660831906861106
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi @proven plank ๐ are you creating your own form for this, or are you using one of our prebuilt elements? Your code snippet is giving me the impression you may be using our split Card Element.
Hello, I'm using my own form for this, and just mount the corresponding Stripe elements (card number, card expiry, and the cvv one)
Gotcha, so sounds like you're at this step:
https://docs.stripe.com/co-badged-cards-compliance?type=custom-integration#pass-network-preference-to-api
That has several approaches depending on how exactly your flow is structured.
Yeah, that's also what I was reading earlier. But I'm kind of unsure how I can add the information which network the user has chosen to the PaymentMethod creation call on the clientside, as that call I shared above just takes the Stripe Element as a whole. And my select box for the network is not related to the Stripe elements in any way
So I figured I need to set some property on the Stripe Element maybe, but that didn't work out
Looking at the stripe.js documentation, could it be that I simply need to use another variation of the createPaymentMethod call? As this one I'm using doesn't allow additional parameters:
stripe.createPaymentMethod(paymentMethodData)
but this one over here:
stripe.createPaymentMethod(options)
does offer a "params" object
If you're creating the Payment Method from Elements, and are suppressing our network selector in favor of your own, then I believe the best time for you to provide the specified network is when creating the Payment Intent that you'll use to charge the Payment Method.
Ah, so it's totally fine if I don't set it on the payment method and wait until the payment or setup intent to do that?
I think so (I haven't explicitly built a test flow for this using a custom flow like you're describing, so there's a tad bit of uncertainty in my answers here).
Or alternatively, it looks like you could make a server-side request to update the Payment Method's card.networks.preferred field:
https://docs.stripe.com/api/payment_methods/update#update_payment_method-card-networks-preferred
That may be easier than storing the preferred network somewhere else and needing to reference it when creating the intent later.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh yeah! I had the same thought a minute ago. I might actually just do that, so it's set with the payment method and should cover all use cases
Thank you for your help toby, I'll try to implement that. If it shouldn't work for some reason, I'll start another thread :)
Any time, happy to help! That sounds good, I'll leave this thread open for a bit longer in case something comes up quickly.
Best of luck with the building though!
Thanks!