#barney_confirmationtoken-sfu

1 messages ¡ Page 1 of 1 (latest)

wooden sailBOT
#

👋 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/1282736431441117255

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

molten bone
#

barney_confirmationtoken-sfu

steel wave
#

@molten bone Thanks - I'm not setting setup_future_usage on creating the token though. I thought that would just be set by the tick-box inside stripe elements. The code to create the token is here https://github.com/thebiggive/donate-frontend/blob/develop/src/app/stripe.service.ts#L85

    const paymentMethodData = {
      billing_details:
        {
          address: {
            country: donation.countryCode,
            postal_code: donation.billingPostalAddress
          },
        }
    };

    return await this.stripe.createConfirmationToken(
      {elements: elements, params: {payment_method_data: paymentMethodData}}
    );
#

('elements' is an instance of StripeElements)

molten bone
#

I thought that would just be set by the tick-box inside stripe elements.
yes if you check that checkbox then it configures setup_future_usage

#

sorry I'm not sure I follow what the issue is since you seem to already understand the behaviour

steel wave
#

thie issue is I'm pretty sure I didn't tick the box but the method still seems to be getting attached to my customer record.

#

And thanks for taking a look at this

molten bone
#

Can you show how you initialize Elements

steel wave
#
  stripeElements(donation: Donation, campaign: Campaign, customerSessionClientSecret: string | undefined) {
    if (!this.stripe) {
      throw new Error('Stripe not ready');
    }

    return this.stripe.elements({
      fonts: [
        {
          family: 'Euclid Triangle',
          src: `url('${environment.donateUriPrefix}/d/EuclidTriangle-Regular.1d45abfd25720872.woff2') format('woff2')`,
          weight: '400',
        },
      ],
      mode: 'payment',
      currency: donation.currencyCode.toLowerCase(),
      amount: this.amountIncTipInMinorUnit(donation),
      setup_future_usage: 'on_session',
      on_behalf_of: campaign.charity.stripeAccountId,
      paymentMethodCreation: 'manual',
      customerSessionClientSecret,
    });
molten bone
#

so you did force it right there?

steel wave
#

That seems extremely reasonable. I made the mistake of only search for setup_future_usage in the backend repository.

#

yes I'm sorry I hadn't remembered that we had that line.

#

I will delete it. Thank you.

molten bone
#

oh no worries at all, it's super hard to track this one because it's not where you confirm

steel wave
#

We can still update the intent to setup future usage from the backend if necassary if we delete that line, can't we?

molten bone
#

yes I think so, I'd recommend testing

steel wave
#

Thanks, will do.

molten bone
#

sure thing, let me know if you hit some error. Our validation for that flow where the information on the ConfirmationToken doesn't match what's on the PaymentIntent can be quite cryptic

steel wave
#

Looks like removing that line makes the payment element prompt the donor to create a Link account, which I'm going to have to turn off in our stripe settings, seems like I can't turn it off from code.

#

It's extra fun because we have backend and frontend in separate repos and I'm trying to make sure we can deploy the backend changes before the frontend changes.

molten bone
#

Link is great though so I'd recommend just keeping it on!

steel wave
#

hmm we're encouraging people to set a password with us that they'll use to access their saved cards, I feel like the link stuff in the payment element is detracting from that by giving an alternative way to set up an account

#

Am I right as far as you know that having setup_future_usage: 'on_session', as we do now is supressing the link account creation?

molten bone
#

it does but only for now, that will change in the future so I'd recommend not relying on that