#matrix-checkout
1 messages · Page 1 of 1 (latest)
Hello
oh ok, hmm. You mentioned using Subscriptions I think though, right? So maybe you use subscription_data[transfer_data]
I wrote this but got an error
subscription_data: {
transfer_data: {
destination: stripeVendorAccount,
amount_percent: 10,
}
},
StripeInvalidRequestError: Received unknown parameter: transfer_data
what could it be?
can you share the full code? and a request ID req_xxx for the error itself https://support.stripe.com/questions/finding-the-id-for-an-api-request
const stripeVendorAccount = 'acct_1Jpu8gFbYZoKrptz';
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price: 'price_1JrhD8KXjwYd84Q4kDUkcpil',
quantity: 1,
},
],
subscription_data: {
transfer_data: {
destination: stripeVendorAccount,
amount_percent: 10,
}
},
mode: 'subscription',
success_url: `https://google.com`,
cancel_url: 'https://yahoo.com',
}
);
does the price needs to be created on the connected account or in my platform?
on the platform
there is no req_id, i am not even able to start the checkout session
in the syntax correct for subscription_data?
there is a request ID(that 'Received unknown parameter' is an API error)
if you look in your logs you'd find it. it's https://dashboard.stripe.com/test/logs/req_VjRgpXRCl9EabH (found it from the Price ID)
ok
you can see you're not using subscription_data there
so it's probably simply you didn't save the file after changing it or didn't deploy the code, etc!
ohw, let me re try
I probably did not save file 😩
now i have got this error: StripeInvalidRequestError: Funds can't be sent to accounts located in US because it's restricted outside of your platform's region;
can I send funds only in my platform region?
yes, see the section at https://stripe.com/docs/connect/account-capabilities#transfers-cross-border
ok thanks
is there a way to add on_behalf_of ?
also: what is my platform region? is it UK or EU?
unfortunately we don't support on_behalf_of for subscriptions
I was going to suggest it but then I remembered that. It's something that we don't really support today unfortunately, it's only supported on single payments and on individual Invoices
as far as we know we treat a UK account as being the same region as the EU for the purposes of this (it's related to regulatory movement of funds and I think Brexit didn't effect this so far) , at least that was the case the last time I looked at this
ok thanks
@placid musk i have now another question. I am testing direct charges now
how can I add an application fee there?
Here is my code so far which works fine but there is no applicaiton fee
const session = await stripe.checkout.sessions.create(
{
line_items: [
{
price: 'price_1Js6eZFbYZoKrptzfh96WP8C',
quantity: 1,
},
],
payment_method_types: [
'card',
],
mode: 'subscription',
success_url: https://google.com,
cancel_url: https://yahoo.com,
}, {
stripeAccount: stripeVendorAccount,
}
);
@next summit you would add subscription_data:{application_fee_percent:10} for example
ok it's working thanks
last question, is there a way for my platform to listen for the following event: successful checkout AND connected account invoice paid?
at the moment i only see an event re my application fee