#matrix-checkout

1 messages · Page 1 of 1 (latest)

placid musk
next summit
#

Hello

next summit
#

now testing

#

i did not use subscription_data

#

but just transfer_data

placid musk
#

oh ok, hmm. You mentioned using Subscriptions I think though, right? So maybe you use subscription_data[transfer_data]

next summit
#

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?

placid musk
next summit
#

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?

placid musk
#

on the platform

next summit
#

there is no req_id, i am not even able to start the checkout session

#

in the syntax correct for subscription_data?

placid musk
#

there is a request ID(that 'Received unknown parameter' is an API error)

next summit
#

ok

placid musk
#

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!

next summit
#

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?

placid musk
next summit
#

ok thanks

#

is there a way to add on_behalf_of ?

#

also: what is my platform region? is it UK or EU?

placid musk
#

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

next summit
#

ok thanks

next summit
#

@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,
}
);

placid musk
#

@next summit you would add subscription_data:{application_fee_percent:10} for example

next summit
#

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

placid musk
#

yep, you'd need to set up a Connect-specific endpoint to recieve events like the invoice.paid event that occur on the connected account