#yanni_code

1 messages · Page 1 of 1 (latest)

steel cometBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1339779779456532544

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

small flame
#

example of a transaction

#

const stripeAccount = await stripe.accounts.create({
country: 'US',
email: user.email,
capabilities: {
transfers: { requested: true },
card_payments: { requested: true },
},
business_type: 'individual',
controller: {
stripe_dashboard: {
type: 'none',
},
fees: {
payer: 'account', // Connected account pays Stripe fees
},
losses: {
payments: 'stripe',
},
requirement_collection: 'stripe',
}
});
Rest of the code that got cutoff.

#

Example of the connected seller account POV

#

I am expecting to see that in the seller POV they have the application fee + stripe processing fees charged to them

#

I did change the code and create a new Seller account through my onboarding system to retest, In that account I do see the following permissions

nocturne blade
#

So it's different on how you create the transaction, not how you created the account

#

There is Direct Charges and Destination Charges. Direct Charges will take stripe fee from your Connected Account. Destination Charge takes from you

#

But even with Destination Charge, you can calculate the total amount and the application fee to cover it, but requires a bit of math

small flame
#

Would I be able to modify my payment intent creation to do a direct charge so that the connected seller is charged the fee from their portion of the sale?

public async createPaymentIntent(data: {
amount: number;
currency: string;
platformFee: number;
creatorStripeAccountId: string;
metadata: any;
email: string;
}) {
const { amount, currency, platformFee, creatorStripeAccountId, metadata, email } = data;

return await this.stripe.paymentIntents.create({
  amount,
  currency,
  payment_method_types: ['card'],
  application_fee_amount: platformFee,
  on_behalf_of: creatorStripeAccountId, // Add this line
  transfer_data: {
    destination: creatorStripeAccountId,
  },
  metadata: {
    ...metadata,
    original_amount: amount,
    platform_fee: platformFee
  },
  receipt_email: email,
});

}
Since it seems my application functions more like a destination charge service
Alternatively like you mentioned would I just be able to calculate the (stripe fee + myplatformfee) and subtract it from the sellers sale so that the math balances?
Am I understanding this correctly?

nocturne blade
#

Sure can, but first what is your Stripe Account type?

small flame
#

Are you asking what type of account is the sellers account?

#

actually i believe this one i am using has a type of none, that might be a bug in my code I think i accidentally deleted the type from the account creation. Previously I was creating accounts with type of 'custom'

#

it might be none because of my combination of controller values:

controller: {
stripe_dashboard: {
type: 'none',
},
fees: {
payer: 'account', // Connected account pays Stripe fees
},
losses: {
payments: 'stripe',
},
requirement_collection: 'stripe',
}

#

in the api doc it says some combinations arent supported

nocturne blade
#

Oh I see your setup. Sorry overlooked this part. Could you share the account Id (acct_xxx) and the PaymentIntent Id (pi_xxx)?

small flame
#

acct_1QsDdOGb1wH5yJjZ pi_3QsDjFGjCeWYtHwE14lAqFqR

#

looking at some previous accounts I had created, they had a type of custom but that was before I modified my code to use the controller variables

nocturne blade
#

Hey sorry gimme a few mins. Being in a MTG

#

I believe it shouldn't have the Stripe processing fee

small flame
#

yeah let me take a look

#

{
"id": "txn_1QsDjLGjCeWYtHwEmzDVgDzW",
"object": "balance_transaction",
"amount": 2000,
"available_on": 1740096000,
"created": 1739496608,
"currency": "usd",
"description": "Application fee from application Relevé for yguenov7@gmail.com (acct_1QsDdOGb1wH5yJjZ)",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": 2000,
"reporting_category": "platform_earning",
"source": "fee_1QsDjIGb1wH5yJjZEvP360BL",
"status": "pending",
"type": "application_fee"
}

#

that looks like my platform fee

#

which looks correct

#

the transaction i processed looked like this
total: $100
platform fee 20% : $20
stripe fee: $3.20

#

i expected to see a balance of $20 coming to my main account, but instead i saw 20-3.20 = $16.80

#

because the stripe fee got offloaded onto me instead of the sellers account

nocturne blade
#

Yeah I see that. This part, correct?

small flame
#

correct

nocturne blade
#

Um I think this is just meaning -$3.2 was taken from the Transaction, but it still be taken from ($100-$20) on the Connected Account, and you still receive the full $20

#

But let me confirm

small flame
#

im just seeing in my main account balance that the values are like this and not round numbers of 20

nocturne blade
#

Yeah saw that too.. Looking

small flame
#

I hope i explained what i am trying to accomplish correctly. Im just trying to route the stripe fee to the Connect account belonging to the seller, but right now it seems my code is configured in some way that its taking the fee from my platforms stripe connect accounts balance instead.

nocturne blade
#

Yes yes it's totally clear, it's just that we are taking time to confirm it. Sorry!

small flame
#

No worries I appreciate the help!

nocturne blade
#

Hey @small flame if you can test quickly, can you create another account with payee = "application", then do a Destination Charge On Behalf Of?

#

Then please provide me the Account Id and the Payment Intent Id again

#

I would like to compare

small flame
#

Sure! Takes me a second to create and run everything

small flame
nocturne blade
#

yes!

small flame
#

ok give me a few moments

nocturne blade
#

Sorry, I think this fee.payer is only possible in case of Direct Charge. You are using a Destination Charge

small flame
#

just in case I just ran the transaction

#

with a new account

#

pi_3QsGkMGjCeWYtHwE0xBCftCQ acct_1QsGd92c0K9rnthL