#heisend3rp

1 messages ยท Page 1 of 1 (latest)

fading latchBOT
faint pollen
#

I'm trying to do this via the webiste btw

eternal peak
#

hi! probably then you can't really turn it off, just a weird quirk.

What are you really trying to test? For example you could just create your PaymentIntent or whatever and explicitly pass payment_method_types:["card"] if you don't want SEPA to appear

faint pollen
#

It's a bigger problem.

We started to deactivate sepa payments for all connected accounts by standard (disputes and stuff ๐Ÿ™„).
We still have saved payment methods in the user. And we retrieve them server side. Afaik stripe checkout component doesn't support displaying saved payment methods.
Since the api returns all saved payment methods for a given type, I added a small check up before, to see if the connected account has sepa debit activated or not.
I'm already done with implementation, I just need to test if it worked ๐Ÿ˜‚

eternal peak
#

hard to dig in really since you're already quite deep, might help if you had the code/API calls you use to do these checks

#

but overall the frontends either use automatic payment methods(and you then configure that in your platform Dashboard on an all-connected-account basis, AFAIK you can't really have a method only active for certain acocunts and not others), or you use payment_method_types explicitly and pass the methods you want

faint pollen
#
 let isSepaActive = false;

    if (tenant.stripeAccount) {
      const stripeAccount = await stripe.accounts.retrieve(
        tenant.stripeAccount,
      );

      isSepaActive =
        stripeAccount.capabilities?.sepa_debit_payments === 'active';
    }

    const savedCards = await stripe.paymentMethods.list(
      {
        customer: userStripeCustomerIdForTenant,
        type: 'card',
      },
      { stripeAccount: tenant.stripeAccount },
    );
    let savedSEPA: Stripe.ApiList<Stripe.PaymentMethod> | null = null;

    if (isSepaActive)
      savedSEPA = await stripe.paymentMethods.list(
        {
          customer: userStripeCustomerIdForTenant,
          type: 'sepa_debit',
        },
        { stripeAccount: tenant.stripeAccount },
      );

    const allSavedPaymentMethods = [
      ...savedCards.data,
      ...(savedSEPA ? savedSEPA.data : []),
    ];
#

yes we use automatic payment methods.

Yes you can set standards and the connected accounts decide on their own. Pretty new feature, pretty neat

eternal peak
#

ok, so you check their capabilities

faint pollen
#

I just need to overwrite in connected account ๐Ÿ˜ข

eternal peak
faint pollen
#

Each connected account can override the default payment method setting below, excluding any you block access to.

eternal peak
#

yep, and they would log into their dashboard and do that(you as the platform can't control it)

#

it doesn't work in test mode I suppose because weird test/live mode account stuff I guess

faint pollen
#

ok, weird test/live mode account stuff I guess it is

#

can you write a bug report? ๐Ÿ™ƒ

#

thanks ๐Ÿ™‚

eternal peak
faint pollen
#

too lazy for that ๐Ÿ˜‚

#

have a good day, and thanks for the help ๐Ÿ™‚

#

@eternal peak capabilities doesn't work. it still active event though it's disabled now for the connected account (blocked it for all connected accounts in test mode).

How can i check if sepa is active for an account or not?

eternal peak
#

as far as I know you can't

faint pollen
#

I can verify that the change worked, since the checkout element does not show sepa any more

eternal peak
#

the Capability is just "can the account support this, has it onboarded to the method" (it's an older API that predates this whole automatic payment method feature)

#

it's different from if it's enabled on their dashboard and as far as I know there's no API access to those settings

faint pollen
#

this would be so much easier if the payment element would support adding a stripe customer id. and then showing supported & saved payment methods for this stripe account/ stripe customer

#

so there is no way we can do this for now?

#

guess error message after payment attempt is the best solution then?

(but its super bad ux)

eternal peak
#

not for now but we do have various plans for making the client-side display of saved payment methods better