#xaositect_display-paymentmethods-legacy

1 messages ยท Page 1 of 1 (latest)

errant bloomBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

heavy crest
#

here's what I get from a curl request:

{
  "id": "ba_1QXxHSFXc3zoUgUuiCLZzT6p",
  "object": "payment_method",
  "allow_redisplay": "always",
  "billing_details": {
    "address": {
      "city": null,
      "country": "US",
      "line1": null,
      "line2": null,
      "postal_code": null,
      "state": null
    },
    "email": null,
    "name": null,
    "phone": null,
    "tax_id": null
  },
  "created": 1734666818,
  "customer": "cus_FapqH0OyuMmSbt",
  "livemode": true,
  "metadata": {},
  "type": "us_bank_account",
  "us_bank_account": {
    "account_holder_type": "individual",
    "account_type": "checking",
    "bank_name": "BANK OF AMERICA, N.A.",
    "financial_connections_account": null,
    "fingerprint": "z93VWUbmVUsbEhtk",
    "last4": "0722",
    "networks": {
      "preferred": "ach",
      "supported": [
        "ach"
      ]
    },
    "routing_number": "063100277",
    "status_details": {}
  }
west fjord
#

Hi there. I'll be right with you

heavy crest
#

thank you

#

fyi I did re-test this in dev today ( same code as in production ) and there one can use the previously saved payment method, which is what makes me assume there is some extra bit of live rules that we're ignorant of?

west fjord
#

Two questions: in dev are you dealing with a ba_ object, as opposed to a pm_ object?
B: Can you give me the options that you're passing to the Elements instance and also to the Payment Element?

heavy crest
#

in dev bank accounts created from the payment element do seem to return a pm_ object

#

Let me check options...

#

In the payment element:

                options={ {
                    paymentMethodOrder,
                    layout: {
                        type: 'tabs',
                        defaultCollapsed: user?.isLoggedIn,
                    },
                    fields: {
                        billingDetails: {
                            email: 'never',
                            name: 'never',
                        },
                    },
                    terms: {
                        card: 'never',
                        usBankAccount: 'never',
                        applePay: 'never',
                        googlePay: 'never',
                    },
                    ...( multiplePaymentsAtOnce
                        ? {
                            wallets: {
                                applePay: 'never',
                                googlePay: 'never',
                            },
                          }
                        : {} ),
                } }
#

confirm logic looks like this:

        const res = await stripe.confirmPayment( {
            clientSecret: clientSecret,
            elements,
            confirmParams: {
                return_url: returnUrl,
                payment_method_data: {
                    allow_redisplay: isAnonymousView ? 'limited' : 'always',
                    billing_details: {
                        email: contact.customer?.email,
                        name: `${ contact.firstName } ${ contact.lastName }`,
                    },
                },
            },
            redirect: 'if_required',
        } );
#

elements:

                        options={ {
                            ...sessionSecrets,
                            ...appearance,
                        } }

sessionSecrets are both a paymentIntent and a customerSession secret

west fjord
#

๐Ÿ‘

heavy crest
#

sorry about that, folks are asking me questions and... I'm so good at multitasking

west fjord
#

I feel that

#

๐Ÿ˜…

heavy crest
#

Do these answers satisfy or did I miss something?

west fjord
#

No, that's great. I'm looking

#

do you have pm_ type objects in production that you can try with? I think that is the reason you wouldn't see this. I was trying to find one on my test account

heavy crest
#

Looking

#

Yes if I add a card, it comes back starting pm_ and then it does get returned in this call stripe.customers.listPaymentMethods( customer.stripeCustomerId, {
allow_redisplay: 'always',
} )

And I can use it to pay an invoice

#

Is there some extra data we need to be collecting for bank account in order to allow redisplay?

west fjord
#

No, I think its just that in the example you gave, the bank account was created from a legacy ba_ source here:

https://dashboard.stripe.com/logs/req_oxe4G2BgSxlUpi

Whereas if you collected a new ACH Direct Debit payment method in the Payment Element today you would get a pm_abc

heavy crest
#

No, I created this payment method today

#

I can delete it from the customer account and double-plus-confirm that

west fjord
#

ba_1QXxHSFXc3zoUgUuiCLZzT6p was created on 2024-12-20 03:53:39

heavy crest
#

aha... I think you have given me the clue. There's some subterfuge going on here.... let me try something

west fjord
errant bloomBOT
heavy crest
#

Okay, I now understand the problem. In order to avoid duplication of customer payment methods, we were deleting payment methods where they had the same fingerprint as a payment method already existing. So I did add a new one this morning... and then deleted it.

Ugh....

Okay, I think we see the path here.

#

After deleting the old stripe payment method from the dashboard and then re-adding it via the gui I do see it in the expected locations and can pay with it.

#

Sorry for the run-around.

dusky tapir
#

Glad you figured it out. No worries about the confusion, we're here to help.

heavy crest
#

๐Ÿ‘‹ back to the salt mines

dusky tapir
#

๐Ÿซก