#Eman - connect subscriptions
1 messages ยท Page 1 of 1 (latest)
No problem ๐
This is possible
However for subscriptions you don't pass paymentintent data
What are you trying to pass exactly there?
I am trying to pass the application_fee_amount
subscription = await stripe.checkout.sessions.create({
customer: customerID,
line_items: [{
price: priceID,
quantity: qty,
tax_rates: taxRates
}],
payment_intent_data:{
application_fee_amount: 10,
},
mode: 'subscription',
success_url: succ_url,
cancel_url: cancel_url
}, {
stripeAccount: connectedAccountId
});
this is the code snippet
Ah ok
You use subscription_data instead: https://stripe.com/docs/api/checkout/sessions/create?lang=python#create_checkout_session-subscription_data-application_fee_percent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this would go instead of line_items I suppose right?
No you would use both
does the customer need to be in my account or in the connected account?
now im getting no such customer error
I know the id is valid in the connected account but not in mine
What type of connected account are you using?
standard
Gotcha
Take a look at this: https://stripe.com/docs/connect/authentication
You have to specify the connected account
I updated the call like this
so when initializing stripe I have to pass it
Hi there! I'm stepping in here for @spare knot. The customer does need to be on the Connected Account if you are passing a customer ID here.
Sorry but I didnt understand the last part.
Also you don't need to duplicate items if you are already passing line_items
I have just tried to initialise it using the following
const stripe = Stripe(stripeKey, {stripeAccount: connected_account_id});
Uncaught Error: Config object may only contain the following: apiVersion, typescript, maxNetworkRetries, httpAgent, timeout, host, port, protocol, telemetry, appInfo
but getting this
Yeah you want to pass the Stripe Account header with your API Request, not upon your initialization of Stripe.
You are already passing it in your code snippet above to create the Checkout Session, which looks good. You can remove it from your stripe initialization.
You stated that prior you were hitting an error about the customer correct?
I assume that is because you are creating the customer without passing the Stripe Account header for your Connected Account in that request.
The customer must live on the Connected Account where the Checkout Session is taking place
I created the customer in the connected account using the web
I tried passing a one time payment and it worked
i'm just stuck on subscriptions
Currently you are trying to both pass transfer_data.destination and create the Session on the Connected Account. This isn't possible as these are conflicting.
transfer_data.destination is used to create the Sub on your Platform and transfer funds to the Connected Account.
ah ok
Since you are using Standard Accounts you want the Subscription to live on the Connected Account.
So you remove the transfer_data.destination and just create the Session/Subscription on the Connected Account
exactly
I still get the following error though
You can not pass `payment_intent_data` in `subscription` mode.
Yep, that's because you can't do that :). You need to use Subscription_data to pass application_fee_percent: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-application_fee_percent.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh so it needs to be a percent
And you can remove subscription_data.items since you are already passing line_items
cant have it as a flat fee
Yeah flat application fee isn't supported for Subscriptions