#steven-t_unexpected

1 messages · Page 1 of 1 (latest)

fleet condorBOT
#

👋 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/1288218809165025375

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

median linden
trail rivet
#

Hello
Is this test mode or live mode?
It takes a while for the balance to become available.

You can try using this test card instead: https://docs.stripe.com/testing#available-balance

That should move funds directly to the available balance once payment succeeds

median linden
#

It is test mode

trail rivet
#

Gotcha. Try using the test cards I linked

median linden
#

I was trying alipay

#

and the test page showed, that means the payment method shall be ok, right?

#

I mean the authenticate to approve alipay test page

trail rivet
#

Correct. Only the test cards I shared above settle funds immediately.

Any other payment method like Alipay would take the same amount of time to settle funds as it'd take in live mode.

median linden
#

I see, you mean if I'm in test mode, shall use test credit card instead of test alipay, right?

trail rivet
#

correct

median linden
#

In that case, how do I test alipay/wechat pay flow? just assume it works if test credit card works?

trail rivet
#

yup

#

or you could wait for a few days for the funds to settle.

#

Basically, listen to balance.available webhook events and create a transfer after the balance becomes available

median linden
#

That's not test mode, I supposed the test mode shall have done it automatically, anyway, thanks for the hint, I'll try it out

trail rivet
#

The default behaviour is to transfer funds from the platform account’s available balance. Attempting a transfer that exceeds the available balance fails with an error. To avoid this problem, when creating a transfer, tie it to an existing charge by specifying the charge ID as the source_transaction parameter. With a source_transaction, the transfer request returns success regardless of your available balance if the related charge has not settled yet. However, the funds don’t become available in the destination account until the funds from the associated charge are available to transfer from the platform account.

median linden
#

you are suggesting I monitor balance.available event? but I don't see that event emitted by stripe client

#

Do you mean charge.succeed?

trail rivet
#

Alternatively, you can use source_transaction parameter while creating a transfer after listening to charge.succeeded

median linden
#

I see, I look into the balance.available API first

#

how do I trig the event? I create PI like this:
const pyInt = await stripe.paymentIntents.create({
amount,
currency,
description,
payment_method_types,
capture_method: 'automatic',
metadata: meta
})

#

do I need add any more argument for the balances.available?

trail rivet
#

You should confirm the payment with the test cards I shared earlier

#

once the payment succeeds, it should update the balance and generate the event

median linden
#

ok, let me check if test credit card work or not first

#

4242 test credit card also had the same issue:

#

what to do?

#

BTW, what test cards you recommended? you were pasting the link of balance.available

#

4242 4242 4242 4242 is supposed to be working' right?

#

Is it because my stripe dashboard is on live mode, not test mode?

#

I suppose the stripe cli is doing that and I don't need to change the dash board to test mode, is it correct?

trail rivet
#

4000000000000077

median linden
#

thanks, let me try

#

0077 works

#

anything I need to do or we can assume it works?

#

with alipay/wechatpay

#

do I need trap balance.available in webhook?

trail rivet
#

Yes like I mentioned before, this is a test card specifically designed to move funds to available payments. It is to test if your transfer code works or not.

In live mode, you should check if you have enough balance before you create a transfer or use source_transaction parameter as suggested above

median linden
#

That's just for checking if funds available for transferring, right? it won't resolve the problem if insufficient funds happens

trail rivet
#

That's just for checking if funds available for transferring, right?
what are you referring to?

median linden
#

source_transaction

trail rivet
median linden
#

I see, where do I set source_transaction, url?

#

or sample code?

trail rivet
median linden
#

In this case, it won't check fund, but actually the transferred fund will be available after fund available, right?

trail rivet
#

correct

#

the request won't fail

median linden
#

as long as the connect could receive the amount, it shall be ok, this is a good solution, thanks

trail rivet
#

NP! 🙂 Happy to help