#xaositect_code

1 messages ยท Page 1 of 1 (latest)

copper ospreyBOT
#

๐Ÿ‘‹ 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.

frail river
#

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.

Learn how to accept a payment and save your customer's payment details for future purchases.

ember quest
#

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?

frail river
#

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

ember quest
#

ok, looking at these now....

copper ospreyBOT
frail river
#

Hi Hanzo, I'm here making trouble again

ember quest
#

specifically billing details are missing

frail river
#

Interesting. So assuming I added those billing details in creation, they'd show up

ember quest
#

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

frail river
#

Alright, I'll see if I can make some alterations to my code and see if that works!

#

Should just take a moment

charred heron
#

Can you try adding billing_address_collection to auto explicitly when you create the checkout session?

frail river
#

serverside?

charred heron
#

Yup

frail river
#

Turning that on definitely prompts for address details in the checkout session.

charred heron
#

Yup, so if you update that payment method with required values then that should likely work

frail river
#

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

charred heron
#

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"..

frail river
#

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?

charred heron
#

The custom mode won't work with link unfortunately.

frail river
#

lol, it is always something!

charred heron
#

Yup, it's a new flow that's being iteratively released so it's in a weird place ๐Ÿ˜…

frail river
#

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

frail river
#

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

charred heron
#

are you using confirmPayment or confirmSetup ?

frail river
#

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....

charred heron
#

All good!

frail river
#

Okay lets see what happens if I add that into confirmSetup

#

Success!

Thank you so much for bearing with me.

charred heron
#

NP! It was solanum who did the hard work of identifying what was going wrong ๐Ÿ™‚

frail river
#

Please give them another thanks from me. I really appreciate you all so much.

charred heron
#

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 ๐Ÿ™‚

frail river
#

Little point in shooting the messenger, though sometimes it can feel very satisfying.