#IsmailSarikaya-net amount
1 messages ยท Page 1 of 1 (latest)
taking a quick look
thank you. that's just one of them. we got this error from every payment intent result(success or fail).
you're just missing one thing
What is it?
instead of foreach (var item in paymentIntent.Charges) you should use foreach (var item in paymentIntent.Charges.Data)
I am checking right now.
and you can probably directly use net = paymentIntent.Charges.Data[0].BalanceTransaction.Net
Oh no sorry scratch that
you'll have get the BalanceTransaction Id and then you'll have to retrieve that transaction to get the Net
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Both of them don't work.
As I said, previously, I tried to get data by using:
BalanceTransactionService service = new BalanceTransactionService();
BalanceTransaction balanceTransaction = service.Get("txn_3L1ShSGahl7zcpSg0nA33j1M");
But this does not work as well.
what I'm trying to say is that you need to first get the balance transaction id paymentIntent.Charges.Data[0].BalanceTransactionId and then retrieve it
Oh wait
what are you using as secret?
you're Platform's?
you should never share your secret in a public channel
please delete it here
and I would advise you roll your key https://stripe.com/docs/keys#rolling-keys
Yes I know, I shared it because it's test.
even if it's a test better be safe
Yes I will roll it.
they would be able to pollute your test environment
to go back to your issue
you are creating a PaymentIntent using both your secret key and the Stripe Account of your Connect Account
right?
I mean, yeah, I used following page to get keys:
https://dashboard.stripe.com/test/apikeys
In backend I am using secret key here and in mobile app we are using publishable key.
So I use this secret key to create payment intent then send payment intent id to mobile.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
could you share the code from your backend that creates the Payment Intent
There's something here I'm not following
when you're configuring your Backend are you passing the Platform or the Connect Account key to StripeConfiguration.ApiKey?
I am setting StripeConfiguration.ApiKey just once at the start up of the application(Program.cs)
yes, but what key are you using? the Platform's or the Connect Account's?
with the secret key. I actually don't understand differencen between Platform and connect account key.
In Stripe, I only find two keys. One is secret and other is publishable key.
you have a main Account which we refer to as Platform Account
and you application has merchants, their accounts are refer to as Connect Accounts
If you say the account which is located top-left. It's always company's account not my account.
This must be clearer.
Hi. Taking over here. Can you share the request ID (req_123) of the request that's failing?
Or share the error message you are receiving?
Just want to know what the error message is here: BalanceTransaction balanceTransaction = service.Get("txn_3L1ShSGahl7zcpSg0nA33j1M");
req_ns4lki3XzfX3eK
Stripe.StripeException: 'No such balance transaction: 'txn_3L1ShSGahl7zcpSg0nA33j1M''
That's the wrong request ID
Can you share the one for retrieving the balance transaction
That's the one for confirming the payment intent
I can share raw webhook payload, if you want?
This error: No such balance transaction occurs when you are retrieving an object off of the wrong account. The object txn_3L1ShSGahl7zcpSg0nA33j1M lives on the connected account: acct_1KyD9wGahl7zcpSg. I suspect you are using the platform's API key to retrieve the balance transaction. This is the usual cause
Try passing the stripe account header: https://stripe.com/docs/connect/authentication
Hmm, you say I am trying to reach an information of a connected account and stripe prevents me to do this?
In order to reach his account's information, I need to pass his account id?
Yes because they are separate accounts
But since that account is connected to the platform, you can access it via the stripe account header (even with the platform's api keys)
I recommend reading that link above
Ok, that make sense. Thank you. I will try this. And yes I tried to reach the connected account ๐
Gotcha. No problem!