#IsmailSarikaya-net amount

1 messages ยท Page 1 of 1 (latest)

timber light
#

๐Ÿ‘‹ happy to help

#

do you have the event id evt_xxx ?

dim ledge
#

Hi again ๐Ÿ™‚ , let me check.

#

evt_3L1ShSGahl7zcpSg0aCRlqRM

timber light
#

taking a quick look

dim ledge
#

thank you. that's just one of them. we got this error from every payment intent result(success or fail).

timber light
#

you're just missing one thing

dim ledge
#

What is it?

timber light
#

instead of foreach (var item in paymentIntent.Charges) you should use foreach (var item in paymentIntent.Charges.Data)

dim ledge
#

I am checking right now.

timber light
#

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

dim ledge
#

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.

timber light
#

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

dim ledge
#

๐Ÿ™‚

#

I did it.

timber light
#

what are you using as secret?

#

you're Platform's?

#

you should never share your secret in a public channel

#

please delete it here

dim ledge
#

Yes I know, I shared it because it's test.

timber light
#

even if it's a test better be safe

dim ledge
#

Yes I will roll it.

timber light
#

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?

dim ledge
#

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.

timber light
#

could you share the code from your backend that creates the Payment Intent

dim ledge
#

group id is lower case guid.

timber light
#

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?

dim ledge
#

I am setting StripeConfiguration.ApiKey just once at the start up of the application(Program.cs)

timber light
#

yes, but what key are you using? the Platform's or the Connect Account's?

dim ledge
#

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.

timber light
#

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

dim ledge
#

If you say the account which is located top-left. It's always company's account not my account.

#

This must be clearer.

hearty igloo
#

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");

dim ledge
#

req_ns4lki3XzfX3eK

#

Stripe.StripeException: 'No such balance transaction: 'txn_3L1ShSGahl7zcpSg0nA33j1M''

hearty igloo
#

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

dim ledge
#

I can share raw webhook payload, if you want?

hearty igloo
#

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

dim ledge
#

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?

hearty igloo
#

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

dim ledge
#

Ok, that make sense. Thank you. I will try this. And yes I tried to reach the connected account ๐Ÿ™‚

hearty igloo
#

Gotcha. No problem!