#xaositect_api
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/1389318271043637280
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- xaositect_best-practices, 6 days ago, 19 messages
Hi there!
Hello
Is there a doc you're following to set this up? If so, can you share a link so I'm on the same page?
Sure, here's what I'm looking at https://docs.stripe.com/payments/existing-customers?platform=web&ui=embedded-form#display-additional-saved-payment-methods
Sorry should have added that to the submission
Thanks, and can you also share the code you're using to create this Checkout Session?
An example request (req_123 - https://support.stripe.com/questions/finding-the-id-for-an-api-request) would help as well
const session = await stripe.checkout.sessions.create( {
payment_method_types: [ paymentMethodType ],
mode,
customer: stripeCustomerId,
client_reference_id: paymentInstallment.id,
metadata: {
paymentInstallmentID: paymentInstallment.id,
environment: process.env.ENVIRONMENT || '',
},
line_items,
payment_intent_data:
mode === 'payment'
? {
description: `Payment for ${ paymentInstallment.name }`,
statement_descriptor: rpcShared.invoices.createStatementDescriptor(
invoice.organization.name
),
transfer_data: {
destination: invoice.organization.stripeID || '',
amount: amountToTransferToPlatform,
},
setup_future_usage: 'off_session',
}
: undefined,
payment_method_options: {
us_bank_account: {
verification_method: 'instant',
financial_connections: {
permissions: [ 'payment_method', 'balances' ],
},
},
},
saved_payment_method_options: {
allow_redisplay_filters: [ 'always' ],
},
ui_mode: 'custom',
return_url: returnUrl,
} );
let me see if I can find an id for one of those requests
req_FmXCPoWVf6UEXf
Thanks, looking
If you click on "change" option, do you see other saved payment methods?
No, just the new payment method option
oh that's link.. What if you logout of link?
If I log out of link I just get the plain card widget
Peculiarly if I display the ACH widget, I get a whole boatload of payment methods that are not attached to the customer account
Is the site you're testing with remotely accessible? if so, can you share a link to the checkout page?
yes, but I'd need an IP address to let you past our WAF shield
Hmm actually, let me just try reproduce this with a web app on my end
give me a few
Okay, thanks!
realized what I had deployed was the previous ticket I was working on, so I'm currently deploying the branch with the above code in it which will probably take a bit.
but what was described above was in local dev
Ah alright. Keep me updated if you see anything different
Yup, same experienfce when deployed ๐ข
I just realized you're using Checkout Session with mode: 'custom' and I don't know if we support rendering saved payment methods on Payment Element with Checkout Sessions API (except Link)
I know we do support it via CustomerSessions - https://docs.stripe.com/payments/existing-customers?platform=web&ui=elements
yes, that would be a fly in the ointment
For example, it works fine with mode embedded as well
and you can replicate that it doesn't work with custom?
Yup
Is it intended, or should I file a bug report?
If so, I'm curious as to the rationale, if they know it
Is it something we might expect to see fixed in the near future, or would you recommend a workaround and not wait?
looks like the product team is still working on the fix but I can't provide an ETA unfortunately.
There are no workarounds for this afaik
What we were doing previously was displaying previously added payment methods in a dropdown in addition to 'new card / new ach' and then if they selected one of those, creating a payment intent, etc....
Okay, well I'll go report back to my team.
Thank you for helping clarify the issue, I appreciate it.
oh actually
Can you try following?
fetchClientSecret: () => {...},
elementsOptions: {
savedPaymentMethod: {
enableSave: 'auto',
enableRedisplay: 'auto'
}
}
});```
that works for me without link as well
I do get a type error in the front end with those args:
Object literal may only specify known properties, and 'savedPaymentMethod' does not exist in type 'StripeCheckoutElementsOptions'
Hmm could you disable typescript linter for that specific line?
Oh yeah, easily. It doesn't seem to make a difference though. should I disable link and see if that changes anything?
Yes if you can, I think those PMs should still show because they should be the ones saved to the Stripe customer. hanzo had to step out so I can help from here, but I am still working to get my local test page for this working
Thanks Hanzo, sorry for invading your lunch hour!
Okay let me see about disabling link
Is the only way to disable link through the stripe dashboard payment methods or is there a param for checkout session that I'm missing?
Looks like there isn't a client-side way to do this but you can specify payment_method_types when creating the Checkout Session and pass your own array of types in. So if you just pass payment_method_types=['card'] that should work for this test https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_types
its curious because right now I'm only passing in 'card' or 'us_bank_account' for the paymentMethodTypes
oh curious,
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 apologies for missing that. Yep that will do exactly what you need here!
no if I exclude link I get no saved payment methods, alas
Though I see now that I'm 2 minor versions behind the current version of the API. Lets see if that changes anything
alas no change
Gotcha, also after talking to my colleagues a bit more on this, it looks like the non-Link version of this isn't supported yet. We have this doc on making your own UI to display saved PMs though we are aiming to enable it soon so if you wait a bit this may be easier.
https://docs.stripe.com/payments/checkout/save-during-payment?payment-ui=embedded-components