#ekaterina-transfers-in-test-mode

1 messages ยท Page 1 of 1 (latest)

night cobalt
#

Hey there! You can get some available balance for transfers in test mode by using the "bypass pending" test cards for some payments here:

#

eg: 4000000000000077

stable hamlet
#

Hello !

#

Thanks ! I dont really understand , where do I put these card data , since I am making transfers through the API , like this :

#

transfer=await stripe.transfers.create({
amount: total,
currency: 'eur',
destination: supplierStripeId,
transfer_group: transferGroupId
});

night cobalt
#

You need to collect payments first to increase your balance

#

Most of the successful test card (like 4242) will have the balance "pending" and you can't transfer it, unless you use source_transaction and link to the pending payment

stable hamlet
#

I have done that , and the balance of my strip test account is like 15K , yet it still shoes that I cannot make transfers because I have no funds

night cobalt
#

But if you use those special test cards for payments, you get available balance right away

#

and can make transfers

#

You also need to switch to manual payouts, otherwise the available funds are earmarked for automatic payouts

stable hamlet
night cobalt
#

Well that's 0 available

stable hamlet
#

How can I make it available ?

night cobalt
#

Can you share the account or any example test payment you made to increase you balance?

stable hamlet
#

sure

#

req_gTWKtlE3fn8dkF

#

oh , the account

#

1 sec please

#

acct_1Jw4DJPPR7urhNAb

#

And this is how I did it :

#

transfer=await stripe.transfers.create({
amount: total,
currency: 'eur',
destination: supplierStripeId,
transfer_group: transferGroupId
});

night cobalt
#

request is great, no worries

stable hamlet
#

Thanks !

night cobalt
#

well, wait

#

a couple things:

#
  1. this request is for a different account than the one you just shared
#
  1. this request is for creating a checkout session, not creating a payment
stable hamlet
#

yes , doesnt the checkout session implicitly handle the payment ?

stable hamlet
#

This one should match : req_jGQSeIWsRbxGjr

stable hamlet
night cobalt
#

I don't see any recent payments on your paltform account using those test cards

#

i mean, on your platform you need to collect payments using those test cards to accrue an available balance

stable hamlet
#

Can it be because I only accumulate balance with the checkout sessions ? (instead of the paymentIntent )

night cobalt
#

You can use checkout if you like, though it is not necessary. EIther works.

#

The improtant thing is using one of those two test cards.

stable hamlet
#

Ah damn , I will give it a try

#

All this time I've been trying a complete 42 sequence

night cobalt
#

yea, you must use 4000000000000077 or the other "bypass pending" card

#

otherwise it'll sit as pending

stable hamlet
#

I am trying right now

#

Thanks so much , I will get back with the updates asap

#

For some add reason , it makes the balance go negative with each payment

#

odd*

#

Even tough my basket total is over the application_fee_amount

#

This is how I create the session :

#

line_items: orderData.map(orderProduct => {
return {
price_data: {
currency: 'eur',
product: orderProduct.stripeId,
unit_amount: orderProduct.price * 100,
},
quantity: orderProduct.quantity,
}
}),
payment_intent_data: {
transfer_group: transferGroupId,
application_fee_amount: 123,
transfer_data: {
destination: stripeAccount,
},
}

night cobalt
#

Is application_fee_amount: 123 enough to cover the Stripe fees?

stable hamlet
#

I thought so , yes , but just to make sure I will dramatically increase it

#

You were right ! It was way too low. Yet the behaviour I had expected would be to receive all the receipts (because I didnt make the transfer yet )

night cobalt
#

receive all the receipts
sorry, not sure what you mean by this. Can you describe that another way?

stable hamlet
#

Sure

#

What i mean is , I expected to receive the whole amount of the purchase (say 100 euro) , and then have 100 available => from which be able to make transfers to the supplier of the service

#

100- stripe fee *

night cobalt
#

well you're using a destination charge, which does that transfer for you automatically

#

here is a diagram of what happens with what you're doing:

stable hamlet
#

OOOOO

#

thanks so much ! Will do it right now and update you !

night cobalt
#

np!

stable hamlet
#

But what I cant figure out is how to pass an array of connected accounts ? Because transfer_data is an object , and , in one order , I have to transfer to multiple connected accounts

night cobalt
#

You can't -- that pattern is for transferring to a single account only

#

essentially remove that transfer_data and app fee, just collect the payment as you paltform, then create the transfers after like your other snippet

stable hamlet
#

Got it !

night cobalt
#

๐Ÿ‘

stable hamlet
#

Finally worked synthrider ! You're the man !!!

#

Thank YOU !

night cobalt
#

๐ŸŽ‰

#

You're welcome ๐Ÿ˜„

stable hamlet
#

๐Ÿ™‚

night cobalt
#

I need to step away so Iโ€™m going to archive this thread. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact