#linqisnice_docs

1 messages ยท Page 1 of 1 (latest)

grizzled hemlockBOT
#

๐Ÿ‘‹ 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/1222168062011244556

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

simple pulsarBOT
#

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.

plucky arch
#

Basically, I onboard our customer, he sends out a payment link, it is paid, about 1.5% is taken as fee by stripe. How do I access that data specifically? Application fee in the payment link object gives me 0 back, im assuming this is what we (the platform) take so thats correct, but application fee is not the correct field then

#

one of my test accounts has 10 payments, all at 1300 with a charge of 21.3 by stripe. But the transaction data im getting back from the API above shows

[
{
    "id": "txn_3OyMEZGPWwmX339c1W2kAxXC",
    "amount": 1300,
    "fee": 21.3
  },
  {
    "id": "txn_1Oy24JGPWwmX339crmmFltEz",
    "amount": -2588.66,
    "fee": 0
  },
  {
    "id": "txn_3OxoDAGPWwmX339c1vCUdBe5",
    "amount": 310.66,
    "fee": 11.9
  },
  {
    "id": "txn_3Oxo3wGPWwmX339c0HA6MEzZ",
    "amount": 310.66,
    "fee": 11.9
  },
...
]

(so one of them is right, im not entirely sure what im looking at)

simple pulsarBOT
plucky arch
#

this is for accounting, so the connected partner can pass this data into his accounting software

#

the data structure above is my own, so it may be a bit misleading. amountPaidByCustomer = amount in the balance transaction object

#

changed it

#

im guessing this transaction is between stripe and his ext account

pastel herald
#

Hi ๐Ÿ‘‹ Balance Transaction objects represent a single change to an accounts balance. They do show the Stripe fees that are collected for processing a payment.

#

There are many types of Balance Transactions, and they correspond with a variety of actions.

plucky arch
#

all I know is the connected partner has charged customers 10 tiems with a payment link, each customer paid 1300, the host got 1278.7 or something. How do I retrieve that stripe fee?

#

i see

#

so I should be looking at transactions of type charge?

#

since im retrieving them all right now

pastel herald
#

The amount of the fee collected is provided in the fee field, and then fee_details shows the breakdown of the fee amount.

pastel herald
plucky arch
#

ah alright. But this is the api i should be interacting with for what im trying to achieve?

pastel herald
#

I think so, but I'm having a hard time figuring out exactly what it is you're trying to do. If you're wanting to look at the fees associated with each transaction, then yes you're looking at the right objects for that.

plucky arch
#

my connected partner needs to detail how much he's sold goods for, but also how much he's paid stripe

#

he sold something for 1300 but only got 1278

pastel herald
#

Sounds like you're looking at the right thing then, but let me know if it doesn't give you what you're hoping.

plucky arch
#

but im not entirely sure what kind of data im getting back. these are all thje payments in that account, yet im getting back 310.66. Not sure where thats coming from

#

only one is 1300

#

again amountPaidByCustomer = balanace transaction objects amount, so misleading

#

im gonna change it

pastel herald
#

What is the pattern of your integration, how did you create the Payment Link being used? Could there be a currency conversion happening?

plucky arch
#

here's two of them

#

there sohuldnt be currency conversion happening, both are in SEK

#

I did change one thing actually, which is why the last one may be different. Even though they're all 1300, at first I didnt use on behalf of my connected partner and it was a direct charge

#
        var options = new PaymentLinkCreateOptions
        {
            TransferData = new PaymentLinkTransferDataOptions
            {
                Amount = lineItems.Sum(x => long.Parse(x.Price)),
                Destination = connectedAccountId

            },
            LineItems = lineItems,
            OnBehalfOf = connectedAccountId
        };

        var requestOptions = new RequestOptions
        {
            StripeAccount = connectedAccountId
        };
#

just not entirely sure how the amount can be different, they are the same in the stripe dashboard for all payments

pastel herald
#

Hm, does that code run successfully? It's odd to see both StripeAccount and Destination used simultaneously.

#

Can you paste the ID of some of the Balance Transactions here?

plucky arch
#

might not actually, i think I might've changed that yesterday but this branch isnt updated so thats why it might look like that

#

i know ive tried it successfully after changing to destination charge

#

txn_3OyMEZGPWwmX339c1W2kAxXC

#

txn_3OxoDAGPWwmX339c1vCUdBe5

#

txn_3Oxo3wGPWwmX339c0HA6MEzZ

pastel herald
plucky arch
#

that's odd, never specified anything other than SEK i think

#

actually i've not set the currency in the paymentlinkcreateoptions

#

so it defaults to USD?

pastel herald
#

If you're using Destination Charges, the payments first settle on your Platform account in that account's settlement currency, then a currency conversion happens when the funds are transferred to the Connected Account to match the settlement currency of the Connected Account.

#

The Direct Charge flow would cause funds to settle on the Connected Account directly, already in that accounts settlement currency.

plucky arch
#

hmm ok so that is iuntended behavior then I assume

#

and thats probably what i want as well

#

but I cant recall ever having set the currency of either account

#

cant find the setting in teh dashboard either

pastel herald
plucky arch
#

but both of thoseaccounts are in the same country

#

im not sure how that conversion happens then

pastel herald
#

Sorry, I'm having a hard time keeping everything here straight.

Can you share one example Balance Transaction that you don't understand that I can deep dive into? Along with what you were expecting to see or what is unclear?

plucky arch
#

There's a conversion happening, but both the platform account and the connected account have the same currency. So, I'm not entirely sure why a conversion is happening. If they have different currencies, how can I check that in the dashboard?

#

all I know is, every payment to that connected account was with a payment link @ 1300 SEK. Even with that conversion, I'm not sure how it ends up 310.66

#

txn_3OxoDAGPWwmX339c1vCUdBe5

this is one of them

pastel herald
#

Sorry, to keep sounding confused, but that is from a Checkout Session that you created directly that doesn't seem to be related to a Connected Account at all.
https://dashboard.stripe.com/test/logs/req_V4jim4M7kNoOFT

A currency conversion is happening there because you're using a Price object based in usd
https://dashboard.stripe.com/test/logs/req_2EsN7adv0uWMfi

So the customer is paying in usd and then that gets converted to sek when it settles.

plucky arch
#
    public async Task<IReadOnlyList<Product>> CreateProducts(IEnumerable<StripeProduct> products, CurrencyCode currency, string connectedAccountId)
    {
        var createdProducts = new List<Product>();
        var service = new ProductService();

        var requestOptions = new RequestOptions
        {
            StripeAccount = connectedAccountId
        };

        foreach (var product in products)
        {
            createdProducts.Add(await service.CreateAsync(new ProductCreateOptions
            {
                Name = product.Name,
                DefaultPriceData = new ProductDefaultPriceDataOptions
                {
                    Currency = "SEK",
                    UnitAmountDecimal = product.Price * 100m
                },
                Metadata = new Dictionary<string, string>() { { "InternalProductId", product.InternalProductId } }
            }, requestOptions));
        }

        return createdProducts;
    }

#

how is it USD?

pastel herald
#

That Price wasn't created from code, it was created from the Stripe CLI.

plucky arch
#

ahh ur totally right lol

#

damn

#

that does make a lot of sense haha

#

then i guess its resolved. thanks a lot