#Devik

1 messages · Page 1 of 1 (latest)

drowsy houndBOT
red jewel
#

The 2nd step will collect Stripe fee. You can see the Charge object's Balance Transaction, it has fee breakdown

willow junco
#

Is there a way to calculate this beforehand? At this point I cannot add the fees to the amount I will capture from the customer.

red jewel
#

It should follow this model https://stripe.com/pricing but unfortunately we don't have a Preview API for the absolutely going-to-be-charged amount

willow junco
#

Is this the case only in this particular flow? Can I implement any other flow, where I could know exactly how large the fee will be before I charge the customer, so the customer will have to pay the whole amount?

red jewel
#

Unfortunately, no nowadays

willow junco
#

Ok, so the flow will stay.

#

Thanks!

#

If I have a different question can I continue here or ask in the general chat?

red jewel
#

You can just ask here

willow junco
#

I'm trying to test that flow with some automated tests, particularly the last steps.

I create a charge in my test using
"source" => "tok_bypassPending",
"capture" => false,
The charge is created, the tested code captures it, but if fails on the next step - when the money should be transferred, it says "You have insufficient funds in your Stripe account."

#

The response suggested that I should turn off automatic payouts. When I did there is still a message about insufficient funds, but different:
"Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance)."

red jewel
#

Okie so Payout is different than the payment transaction itself. Here you have the charge succeeded and captured, but it's not available in the balance yet

#

You can try the source_transaction here

willow junco
#

Ok, I will try it. But shouldn't the tok_bypassPending token assure that the funds are there? Or is this a different issue?

red jewel
#

No it's just 2 different phases

willow junco
#

Ok, that seems to work.

One more thing. When I use Checkout Session to make the charge, how can I get the charge id to capture the charge later?

#

Now I have another issue with the tests: "The currency of source_transaction's balance transaction (eur) must be the same as the transfer currency (pln)".
I use the same currency while creating the charge and while initiating the payout.

#

For some reason the charge is made in "eur" despite the fact, that I make it in "pln".

#

I tried capturing the currency from the charge object returned while capturing, but the problem persists.

red jewel
#

Maybe it depends on your account? Which country is it?

willow junco
#

Poland.

red jewel
willow junco
#

I'm trying this in my tests, so no Checkout Session, just manually created charge.
ch_3Mh2HGHGAALtknZ41PtvXDSR

#

"currency": "pln", in the logs.

red jewel
#

Okie, can I have the request id when you have the error of different currency?

#

ah

#

Can I have the request id?

willow junco
#

For the transfer?

#

req_fJCc9C2Z2o99Wi

#

I had to recreate it, so the charge is ch_3Mh2N2HGAALtknZ41xU1lXAR

#

So it seems the balance_transaction is made in EUR for some reason.
Should I not rely on the amount and currency in charge object and retrieve the balance_transaction?

red jewel
#

Yes I guess it's because your bank account is an EUR bank

#

So we automatically convert balance transaction to the currency that is about to be paid out

#

But please reach out to Support to ask about account country and currency

willow junco
#

That are still tests, so no actual bank account, just using the test token tok_bypassPending.
The bank account that is associated with my Stripe account is in PLN.

So this is the issue with the bank account that is associated with my Stripe account and this doesn't reflect a situation where a customer pays from a card that has a different currency?
E.g. I issue a Checkout Session in PLN, but he pays from a card that uses EUR?

red jewel
#

The bank account that is associated with my Stripe account is in PLN.
Yes this bank account. I checked and think it's an EUR or EUR-prioritized bank

#

That's why I recommend checking with Support

willow junco
#

I'll just switch the account.

#

One more thing. When I use Checkout Session to make the charge, how can I get the charge id to capture the charge later?

#

I managed to set the currency to PLN in the dashboard.

red jewel
#

When the Checkout Session is paid, you will have a PaymentIntent inside it, then you have the Charge inside the Payment Intent