#sdasdq3we
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
hi! you'd calculate 10% of the amount and pass the required values to the API(the guide you're using for Connect will have a section for how to pass application_fee_amount).
Can we do something so we don't have to pass amount.
no, it's an API and you need to write code to calculate the appropriate values to define what you are charging your customer and what fee/split you are taking, the API does not take a percentage definition.
hey
Do I have to calculate this amount while I am creating produce and price object?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
You set the application_fee_amount for the 10% of the total amount.
How are you charging your customers right now?
I am creating chekout session
Are you using planning to use Direct Charges (charge happens on the Connected account) or Destination Charges (charge happens on the Platform)?
destination charges
But in any case, you can use the payment_intent_data.application_fee_amount on the Checkout Session object: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-application_fee_amount
Alternatively, because you use destination charges, you can set the payment_intent_data.transfer_data.amount to be 90% (you will need to calculate it yourself) of the total: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-transfer_data-amount
You can read more here: https://stripe.com/docs/connect/destination-charges
Yes but I am not using "PaymentIntentCreateOptions" anywhere in code.
What do you mean?
Where do I wirte code for this payment_intent_data.transfer_data.amount
Could you please share the code where you create the Checkout Session?
{
Customer = companyModel.StripeCustomerId,
LineItems = LineItems,
Mode = "subscription",
SuccessUrl = $"{_httpContextAccessor.HttpContext.Request.Scheme}://{_httpContextAccessor.HttpContext.Request.Host}/CheckOut/Index?session_id={sessionId}",
CancelUrl = $"{_httpContextAccessor.HttpContext.Request.Scheme}://{_httpContextAccessor.HttpContext.Request.Host}/Subscription/CreateSubscription?CompanyId={companyModel.CompanyId}&SubscriptionId={companyModel.subscriptionPlanModel.SubscriptionPlanId}",
PaymentMethodTypes = new List<string> { "card" },
};
if (planDiscountmodel != null && planDiscountmodel.plandiscountid != Guid.Empty && planDiscountmodel.discountamount > 0)
{
options.Discounts = new List<SessionDiscountOptions> {
new SessionDiscountOptions() {
Coupon = planDiscountmodel.stripeplandiscountid,
}
};
}```
string strStripeConnectedAccountId = _configurationRepository.GetConfigurationSettingByParameterName(ConfigurationParameterConstants.StripeConnectedAccountId).ParameterValue;
RequestOptions requestOptions = new()
{
StripeAccount = strStripeConnectedAccountId
};
return service.Create(options, requestOptions: requestOptions);```
Sorry, what language is this exactly?
I believe you should add a parameter like this:
PaymentIntentData = new SessionPaymentIntentDataOptions
{
ApplicationFeeAmount = 500
}
ohk
The 'payment_intent_data[transfer_data][destination]' param cannot be set to your own account.
It needs to be the account ID of your Connected account (where you wish to transfer).
Yes I am passing that account id.
The error message says otherwise.
While creating any product I was not passing "RequestOptions"
Now I am passing it everywhere.
You mean the Stripe-Account header?
Yes
You don't need it if you use the destination charges.
ok
I would suggest you read this article carefully to understand the logic behind it, I hope it will make things clearer (even if you use Stripe Checkout and not PaymentIntents):
https://stripe.com/docs/connect/destination-charges