#barney_confirmationtoken-sfu
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/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.
- barney-laurance_best-practices, 1 hour ago, 17 messages
- barney-laurance_best-practices, 4 days ago, 9 messages
barney_confirmationtoken-sfu
@steel wave it seems this happened when you created the ConfirmationToken, look at this request https://dashboard.stripe.com/test/logs/req_er0eBso7GhV3sk
so you likely set this up client-side in your JS code
@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)
I thought that would just be set by the tick-box inside stripe elements.
yes if you check that checkbox then it configuressetup_future_usage
sorry I'm not sure I follow what the issue is since you seem to already understand the behaviour
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.
Just tested again, same issue with this one: https://dashboard.stripe.com/test/payments/pi_3PxAPzKkGuKkxwBN1kvxJVsL
And thanks for taking a look at this
Can you show how you initialize Elements
You're going to tell me to delete this line I guess https://github.com/thebiggive/donate-frontend/blob/efb00a6afd34edfc555aadd731ecb851abae5b13/src/app/stripe.service.ts#L51
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,
});
so you did force it right there?
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.
oh no worries at all, it's super hard to track this one because it's not where you confirm
We can still update the intent to setup future usage from the backend if necassary if we delete that line, can't we?
yes I think so, I'd recommend testing
Thanks, will do.
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
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.
Btw almost all our code for using stripe is published, part in JS as you saw and part in PHP in this repo https://github.com/thebiggive/matchbot
Link is great though so I'd recommend just keeping it on!
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?
it does but only for now, that will change in the future so I'd recommend not relying on that