#Samsara
1 messages ยท Page 1 of 1 (latest)
Hi ๐ I believe this was recently changed or is planning to be changed soon, please bear with me while I double check the details of that.
Thanks!
Thank you for your patience, my understanding is that now if your Platform registers a domain it will be prepared for use in both Connect and non-Connect scenarios. This change is not retroactive and does not apply to previously registered domains, so you may need re-register previous domains to see this change in behavior. Please let us know if this doesn't align with the behavior you're seeing.
Ok so to clarify, does this mean we have don't have to do the step in the link above everytime we add a new connect account? As long as we have our domain registered at the platform level we're good and apple pay should show up? But for previously created connect accounts, I'll have to register those individually with the domain? And has this change gone into place already or is it a future update?
Ok so to clarify, does this mean we have don't have to do the step in the link above everytime we add a new connect account? As long as we have our domain registered at the platform level we're good and apple pay should show up?
Yes, that is my understanding, and as far as I'm aware this change is now live.
I don't think you need to re-register the domain with each Connected Account, just re-register the domain itself one time.
I don't think that was the behavior I was seeing. We registered the domain here https://dashboard.stripe.com/settings/payments/apple_pay but apple pay wasn't showing up. Then I ran manual commands to register those domains with each connect account we had before and apple pay showed up
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Or do I just need to run the the curl command with our domain is what you're saying?
I'm also confused, is adding a domain to the link above and running the curl command essentially the same thing?
When were you registering the domains, this was a very recent change that was implemented less than a month ago?
We registered our domains yesterday**
Hm, can you share the account IDs?
Of the connect accounts?
Or our platform account?
acct_1LnPzcIOjNfX5RUk
here's one of our connect accounts
acct_1LowvdDTwu9XYxBB
Hello ๐
Taking over as toby needs to step away soon
Which one is the platform here?
Ah you can go to your profile here and scroll all the way to the bottom
https://dashboard.stripe.com/settings/user
and what domain are you specifically looking into?
As far as I can tell, all the domains you have on your platform are setup correctly for connect usecase
How exactly were you initialising Stripe.js?
So we registered all of those yesterday, but apple pay didn't show up until I went back and manually ran the curl commands to register those same domains with the old connect accounts we had
This is the line I'm using to initialize on the frontend:
() =>
loadStripe(stripeConfig.publicKey, {
stripeAccount: getStripeAccountId(stripeConfig.accountId)
}),
[stripeConfig.accountId, stripeConfig.publicKey]
);```
some of that is abstracted ^^ but its the example from the docs
yup basically passing the standard connected account ID
Yup
can you try without passing in the connected account ID?>
I suspect with the new approach, you might not need it anymore
Oh I see...how does stripe know which account to post charges to?
Good question, not sure! looking into it.
Thanks!
My assumption is it's all tied to the client secret?
Since we're doing this on the backend to send back the client secret to frontend
stripeAccountId: string,
amount: number,
partnerName: string,
email?: string,
): Promise<any> {
try {
const stripe = this.getStripeAccount(stripeAccountId);
this.logger.log('pay amount', amount, 'partner', partnerName);
// Include Stripe, create payment, send client secret to the front end
const paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: 'usd',
receipt_email: email,
});
const clientSecret = paymentIntent.client_secret;
return { client_secret: clientSecret };
} catch (exception) {
this.logger.error(exception);
throw new InternalServerErrorException();
}
}```
wait nvm thats wrong code
Yup you're right since this is a direct charge, you'd need the correct connected account ID on the front-end
Also, I don't see you passing the connected account ID while creating the PaymentIntent
But we are doing this ``` async preAuthorizePaymentSecret(
amount: number,
partner: Partner,
email?: string,
): Promise<any> {
const accountId = await this.getStripeAccountId(partner);
// Empty Stripe Account means not set value
if (accountId === '') throw new BadRequestException();
try {
const stripe = this.getStripeAccount(accountId);
this.logger.log('pay amount', amount, 'partner', partner.partnerName);
const data: Stripe.PaymentIntentCreateParams = {
amount: amount,
currency: 'usd',
capture_method: 'manual',
payment_method_types: ['card'],
};
if (email != null && email != '') {
data['receipt_email'] = email;
}
// Setting capture method to "manual" here allows for us to capture it once order has finalized
const paymentIntent = await stripe.paymentIntents.create(data);
const clientSecret = paymentIntent.client_secret;
return { client_secret: clientSecret };
} catch (exception) {
this.logger.error(exception);
throw new InternalServerErrorException();
}
}```
Ah okay so we do need to pass in the connect account
So I guess moving forward, I'm still wondering if individually registering new connect accounts with our domain for apple pay is needed or not? It's not a big deal to do it programmatically but I'm wondering if there's an easy way to check if a connect account is registered with our domain
As toby mentioned earlier, I don't think that's needed anymore since we've changed the flow.
Your server-side code at the moment is creating destination charges since you're not passing in a connected account ID
Which is why initializing Stripe.js with connected account ID might not be showing the Apple Pay button
We are, in the first line const stripe = this.getStripeAccount(accountId)
I didn't write it so I'm not entirely familiar with the API, but thats my understanding?
ah, hmm I'm not exactly familiar with this approach.
With Node SDK, you typically pass it in like this
https://stripe.com/docs/api/connected_accounts?lang=node