#ardis_error
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ 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/1212021513314635826
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ 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. Thank you for your patience!
yes , here is : acct_1OmchvByUmQCNP4b
this my merchant id , connected account id
I've created the client secret using connected account id and try to load payment elements , it gives like this error
var elements = stripe.elements({
locale: elementsLocale,
loader: "always",
clientSecret,
appearance,
});
just give me a second to try to look at your account
okey
how are you initializing the Stripe instance on the frontend?
default is
stripe = Stripe(wpfsFormSettings.stripeKey)
but i tried also with stripeAccount
like
stripe = Stripe(wpfsFormSettings.stripeKey, {
stripeAccount: 'acct_1OmchvByUmQCNP4b'
});
you need to pass in the platform Stripe publishable key
I wasn't able to find a pmc_1Omci1ByUmQCNP4blPJcfMQf on your platform account
are you creating a Direct or a Destination Charge?
the configuration that you should use is here https://dashboard.stripe.com/test/settings/payment_methods/connected_accounts?config_id=pmc_1O7GmvJ5g91RXBK2q2HITCYd
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
not on the Connect account
How can I manage the pmc ?
I create a payment intent on cloud functions
and get the client_secret to pass payment element
from the dashboard (with the link I sent you)
I see , but I mean , how can I pass to stripe , or why don't take itself
I have to pass seperately ?
maybe you're passing it here https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_configuration when creating the PI?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
export const createTestPaymentIntent = async (
req: Request,
res: Response
): Promise<void> => {
try {
leaveBreadcrumb(
"Initiating createTestPaymentIntent",
"createTestPaymentIntent",
{
query: req.query,
body: req.body,
}
);
const accountId = req.query.accountId as string;
const {
amount,
currency,
confirm,
customer,
payment_method,
automatic_payment_methods,
expand,
description,
capture_method,
receipt_email,
metadata,
validLicense,
} = req.body;
var params: any = {
amount,
currency,
confirm,
customer,
payment_method,
automatic_payment_methods,
expand,
};
if (description) {
params = {
...params,
description,
};
}
if (capture_method) {
params = {
...params,
capture_method,
};
}
if (receipt_email) {
params = {
...params,
receipt_email,
};
}
if (metadata) {
params = {
...params,
metadata,
};
}
if (!validLicense) {
const customer = await stripeTest.accounts.retrieve(accountId);
const applicationFeeAmount = getApplicationFeeAmount(
customer,
amount,
"test"
);
params = {
...params,
application_fee_amount: applicationFeeAmount,
};
}
leaveBreadcrumb(
"Creating test payment intent with params: ",
"createTestPaymentIntent",
{
params,
}
);
const paymentIntent = await stripeTest.paymentIntents.create(params, {
stripeAccount: accountId,
});
res.json(paymentIntent);
} catch (error: any) {
logError(error.message, "createTestPaymentIntent", {
error_code: error.code,
});
res.status(500).send(error.message);
}
};
here is my function to create payment intent
do you have the PI ID that was generated?
yes
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
would you mind sharing it please?
it seems you're using the API publishable key of the Connected Account
and not the Platform's
you need to use the Platform's publishable key with the StripeAccount header for the Connected Account
I am connecting using oauth to stripe and using connected account's pk to load payment elements
no that's wrong
you always use the Platform keys
and if you're doing Direct you add the Stripe-Account header
front side ?
i need connect account's pk in any case ?
or in this case , I will always use the platform's pk ?
no
always use the platform's sk and pk
it is usefull when using stripe sdk ?
because our platform also support sdk version
let me try it