#some1ataplace
1 messages ยท Page 1 of 1 (latest)
You can not pass payment_intent_data in subscription mode.
There is subscription_data on that endpoint
checkout_session = stripe.checkout.Session.create(
success_url=request.build_absolute_uri(reverse('memberships:stripe_success')) + '?session_id={CHECKOUT_SESSION_ID}',
cancel_url=request.build_absolute_uri(reverse('memberships:stripe_cancelled')),
payment_method_types=['card'],
customer=customer_id,
allow_promotion_codes=True,
line_items=[{
'price':settings.STRIPE_MONTHLY_PRICE_ID,
'quantity':1,
}],
payment_intent_data={
'transfer_data': {
'destination': 'acct_1Nu7mfIsMFguiimW',
},
},
)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What am I looking for in that link?
This param specifically is how you set the application fee for your subscription when creating a Checkout Session 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.
Like this?
checkout_session = stripe.checkout.Session.create(
success_url=request.build_absolute_uri(reverse('memberships:stripe_success')) + '?session_id={CHECKOUT_SESSION_ID}',
cancel_url=request.build_absolute_uri(reverse('memberships:stripe_cancelled')),
payment_method_types=['card'],
customer=customer_id,
allow_promotion_codes=True,
line_items=[{
'price':settings.STRIPE_MONTHLY_PRICE_ID,
'quantity':1,
}],
subscription_data.application_fee_percent = 100,
)
And how do I connect that to the connect account?
๐ taking over
just to clarify, when you say you want to reward your connected account
what does that mean?
what's the usecase here?
are you trying to transfer specific amount of funds to that account?
aside from what they get from the subscription signup?
also, are you creating these subscriptions on the platform or the connected accounts?
the connected account is an affiliate marketer for my site. When they share an affiliate link, and the viewer of that link makes an account and buys a subscription, I want to reward the affiliate marketer.
Platform subscriptions
So if the monthly platform subscription is $50 USD I want to give a good amount of % to the affiliate marketer. Maybe 50% or $25 reward.
I see.
Since you're creating subscriptions on the platform, what you can do is use subscription_data parameter on the subscription to set transfer_data
That's where you can specify the connected account ID under destination and the precent you want to transfer under amount_percent
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-transfer_data
Yes that looks right. Wondering though how I would do this in python?
subscription_data={
#"items": [{"plan": "YOUR_PLAN_ID"}],
"transfer_data": {
"destination": 'acct_1Nu7mfIsMFguiimW',
"amount_percent": 100,
},
},
I don't neeed the items?
not in subscriptions_data field, no since you're setting line items on the checkout session
Cool i will leave it commented out. But does everything else look good?
I did this:
subscription_data={
#"items": [{"plan": "YOUR_PLAN_ID"}],
"transfer_data": {
"destination": 'acct_1Nu7mfIsMFguiimW',
"amount_percent": 2500,
},
},
https://dashboard.stripe.com/test/connect/accounts/acct_1Nu7mfIsMFguiimW
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I never used connect before. How do I tell it works? Would I see the $25 anywhere?
So right now it shows the full amount $50 but later today it will show $25?
Do I have to log in as the connected account to receive the $25?
No, it happens automatically on subscription creation
hmm even logged in on the eexpress account I see $50
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The subscription was created
Can you share the checkout session creation request ID?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_02qtApelCinEcX
you set amount_percent to 100
https://dashboard.stripe.com/test/logs/req_mdk3N5VcovgRrJ
meaning you transferred 100% of the amount
oh boy thanks i must have not saved the new 2500 when trying it out
So now am I done? The platform doesn't have to do anything now? Stripe will transfer it to the user?
I just have to worry about negative balances? Would I have to do any kind of funding into a balance that the platform account controls?
So now am I done? The platform doesn't have to do anything now? Stripe will transfer it to the user?
Yup
Oh wow you are saying yes to both points?
I just have to worry about negative balances? Would I have to do any kind of funding into a balance that the platform account controls?
Not really as you're transferring the amount you receive from the subscriptions
So if you're not making any explicit transfers
you should have enough balance
Excellent. Where would I see on the dashboard this balance?
Typically under
https://dashboard.stripe.com/balance/overview
Cool. So every stripe platform business needs to add a bank account in order to receive payments from platform subscriptions and also see balances according to connected accounts transfers? I as the platform could always add more money to this balance?
How long do connected accounts usually need to wait for this transfer to make it into their account? Always at the end of the day?
So every stripe platform business needs to add a bank account in order to receive payments from platform subscriptions and also see balances according to connected accounts transfers?
Not sure I fully understand following:
"also see balances according to connected accounts transfers?"
can you elaborate?
How long do connected accounts usually need to wait for this transfer to make it into their account? Always at the end of the day?
It depends on their payout schedule
There is a platform balance? If somehow the connected accounts go negative, I would see the deductions in that balance page from my platform balance?
From my understanding there is a platform balance and a connected account balance
Just to clarify, are you asking about connected reserve balance?
https://stripe.com/docs/connect/account-balances
ah yes i seem to be confused about the both of them
Our team won't know a ton about what dashboard can show etc since we primarily focus on the API integrations but I think it should show any deductions that occur due to negative balances
perfect thank you for all the help hanzo. I am happy now I havee got connect to work and now i have a better idea how it all works. much appreciated!
No worries ๐ happy to help