#john_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/1417701364921798786
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Can you share a public accessible URL?
Also, the request Id when you created the Subscription (req_xxx)
You likely need the address in the PaymentMethod mentioned here
The payment method includes billing_details required by the Checkout Session’s billing_address_collection value:
auto requires values for email, name, and address[country]. US, CA, and GB billing addresses also require address[postal_code].
required requires values for email, name, and all address fields.
^ Common pitfall
⛔️ Stripe developers have stepped away for a short while
Please leave your questions here, and we’ll respond as soon as we're back! If you need help urgently, you can contact Stripe support for help.
hey @wary fern what do you mean publicly accessible url? to the payment form?
i don't create a subscription directly. i'm using stripe.checkout.sessions.create
const createParams: Stripe.Checkout.SessionCreateParams = {
mode: "subscription",
ui_mode: "custom",
customer: stripeCustomerId,
customer_creation: customer ? undefined : "always",
line_items: [
{
price: priceId,
quantity: users,
},
],
metadata,
subscription_data: {
metadata,
},
};
from front-end i'm using <CheckoutProvider><PaymentElement /></CheckoutProvider> (this is nextjs app)
the <CheckoutProvider> is new in Basil and is convenient, but I'm finding that the <AddressElement> and <PaymentElement /> when used inside it is the CheckoutProvider doesn't have the same full features elsewhere.
Yes. Can you check the requirements mentioned here
thanks @wary fern! i tried this out and i couldn't get it to show in the PaymentElement when testing in a sandbox. The requirements you referenced were for "prefill data" - it doesn't mention showing a dropdown of existing payment methods.
- from stripe's customer portal page, it shows all the payment methods (only 1 has redisplay = always, the rest limited)
- i also checked out a stripe hosted invoice payment page and it shows a dropdown with existing payment methods
I'm looking for a way to get the dropdown (not to prefill the fields)
Hello! Stepping in for my colleague here (due to a changing of shift!), give me some time to catch up!
there's this, but i tried it too and it didn't work: https://docs.stripe.com/payments/existing-customers?platform=web&ui=embedded-components#display-additional-saved-payment-methods
my code:
const createParams: Stripe.Checkout.SessionCreateParams = {
mode: "subscription",
ui_mode: "custom",
customer: stripeCustomerId,
customer_creation: customer ? undefined : "always",
line_items: [
{
price: priceId,
quantity: users,
},
],
metadata,
subscription_data: {
metadata,
},
saved_payment_method_options: {
allow_redisplay_filters: ["always", "limited", "unspecified"],
payment_method_save: "enabled",
},
};
i did notice the docusment referenced mode=paymen but mine is for subscription
thanks @celest mica
wait a second. i just tested and it works!
i didn't do anything different
sorry to waste your time.
all good man! Happy that you managed to get the behaviour you wanted!
well, it's only showing the "always" card. i thought if you set the array to include all, it would show all
can you confirm? (i.e. always, limited, unspecified)
actually, i think i figured it out. it's only showing a specific stripe test card - not the test cards i used.
Ok, when you specify:
allow_redisplay_filters: ["always", "limited", "unspecified"],
It should show all the saved payment methods tied to the Customer
I am not sure what you mean by it's only showing a specific stripe test card and not the test cards you used. Could a screenshot of what you are seeing?
this has been bugging me for days and in test mode (dev sandbox) it's only displaying specific cards the stripe uses for testing (i was using a mastacard test card which would never show up)
yeah. let me get you screenshots
here's the customer account on strip dashboard
here's my form: it only shows the 2 latest "visa" cards
the 2 visa cards came from the "Stripe developers" helper at the bottom
i've been testing with the mastercard this whole time and it never showed up.
anyway - i'm hoping this is just some nuances in dev/test mode. but man, i've spent days on this and lots of time with stripe's (and other) AI assistant
Do give me some time to look into this