#xaositect_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/1389671310241828974
๐ 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_api, 21 hours ago, 64 messages
I am back... again!
I had a conversation yesterday with a couple of your team members, but I am still having trouble redisplaying previously added payment methods
They had suggested that those payment methods wouldn't display in a custom checkout, apparently a known bug, but directed me to this https://docs.stripe.com/payments/checkout/save-during-payment?payment-ui=embedded-components#render-saved-payment-methods which also doesn't seem to work for custom.
So I went to embedded, and the ux feels okay. But... I'm still only able to get payment methods added by previous checkout session to display.
hello! looking at this now
redisplaying saved payment detail requirements are different between checkout and other payment surfaces
can you share an example checkout session where you hoped to see a specific payment method but did not, as well as that specific payment method ID?
yes, one moment
here's aa payment method added via the paymentElement pm_1Rg8TNG2avTULfw3EThuY6W3
here's a request for acheckout req_CaHvIlwjvYWuah
cs_test_a1DEylBSLr10huYm2641kZUYCYgbFUvCZbj5q2dIU61D1UO7K5TCuJyvgV but it doesn't seem to take one anywhere in the dashb oard
ok, looking at these now....
Hi Hanzo, I'm here making trouble again
ok, i think this relates to the payment method you provided not meeting our criteria for redisplay as specified here:
https://docs.stripe.com/payments/existing-customers?platform=web&ui=stripe-hosted#prefill-payment-fields
specifically billing details are missing
Interesting. So assuming I added those billing details in creation, they'd show up
they should! it looks like it meets the other criteria
if you want to give that a shot real quick and if you have further issues hanzo can help you figure them out
Alright, I'll see if I can make some alterations to my code and see if that works!
Should just take a moment
Can you try adding billing_address_collection to auto explicitly when you create the checkout session?
serverside?
Yup
Turning that on definitely prompts for address details in the checkout session.
Yup, so if you update that payment method with required values then that should likely work
So I'm creating a paymentIntent to feed to the payment element to create a card ( for future payment ) in the wallet. I don't see any args there for billing details in creating a payment intent. should I provide the billing details in the frontend?
Oh yeah, frontend I guess
Payment Element only requires minimal billing information that is "required" to process a charge successfully. It won't ask for full billing details by default.
You could use Address Element OR just pass the billing details manually via - confirmPayment function - https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
Taking a step back
I'm happy to help you figure out what's going on with mode: 'custom' as I was able to get it working yesterday
Edit: Oh I read the previous thread again and seems like the flow is not supported with "link"..
hmmm, okay I've added some billing details to the payment element:
<PaymentElement
options={ {
layout: 'tabs',
defaultValues: {
billingDetails: {
name: userFullName,
email: user?.user?.email,
address: {
country: 'US',
},
},
},
...( stripeCustomerId && { customer: stripeCustomerId } ),
} }
onChange={ ( event ) => {
if ( event?.value?.type ) {
setSelectedPaymentMethod( event.value.type );
}
} }
/>
oh postal code... okay postal code one moment
Nope, adding the postal code to the above doesn't seem to make a difference, also the postal code is being collected in the Payment Element
Should we try to see if we can custom working, if you got it to work yesterday?
The custom mode won't work with link unfortunately.
lol, it is always something!
Yup, it's a new flow that's being iteratively released so it's in a weird place ๐
So if I curl for the payment method I just added using the Payment Element ( to see if it would show up in the checkout ) I get this:
{
"id": "pm_1Rg9VCG2avTULfw3ri0UJmiH",
"object": "payment_method",
"allow_redisplay": "always",
"billing_details": {
"address": {
"city": null,
"country": "US",
"line1": null,
"line2": null,
"postal_code": "97215",
"state": null
},
"email": null,
"name": null,
"phone": null,
"tax_id": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"display_brand": "visa",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "8IvhvjE2EywUHZ15",
"funding": "credit",
"generated_from": null,
"last4": "0341",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"regulated_status": "unregulated",
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"created": 1751396758,
"customer": "cus_SIzBv8ZyYKrzPJ",
"livemode": false,
"metadata": {},
"type": "card"
ugh email isn't passing through
Instead of setting the values under defaultValues
Try passing it in with confirmPayment - https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
Oh this is the two part flow:
- a customer adds a payment method for future ( using the payment element )
- later they are attempting to do a checkout to pay for something
I don't believe confirmPayment is available for the first section
are you using confirmPayment or confirmSetup ?
I assume you're using a SetupIntent, in which case - you can pass the same via confirmSetup
https://docs.stripe.com/js/setup_intents/confirm_setup#confirm_setup_intent-options-confirmParams-payment_method_data-billing_details
I'm creating a setupIntent in the API, returning the intent in the front, and passing its secret to the options object that is passed into Elements to instantiate the PaymentElement.
OnSuccess I am using confirmSetup.
Okay, I'll try there...
Getting lost in my own codebase....
All good!
Okay lets see what happens if I add that into confirmSetup
Success!
Thank you so much for bearing with me.
NP! It was solanum who did the hard work of identifying what was going wrong ๐
Please give them another thanks from me. I really appreciate you all so much.
Apologies for the friction here. We've flagged the issues you ran into yesterday to our product team so bear with us as we flesh out the feature a bit more to make it seamless ๐
Little point in shooting the messenger, though sometimes it can feel very satisfying.