#steven-t_unexpected
1 messages · Page 1 of 1 (latest)
👋 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.
- steven_paymentintent-fees, 1 hour ago, 61 messages
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
It is test mode
Gotcha. Try using the test cards I linked
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
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.
I see, you mean if I'm in test mode, shall use test credit card instead of test alipay, right?
correct
In that case, how do I test alipay/wechat pay flow? just assume it works if test credit card works?
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
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
You could also try using source_transaction parameter: https://docs.stripe.com/connect/separate-charges-and-transfers?platform=web&ui=stripe-hosted#transfer-availability
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.
you are suggesting I monitor balance.available event? but I don't see that event emitted by stripe client
Do you mean charge.succeed?
No, balance.available should be generated when the funds from the payment are added to the account balance: https://docs.stripe.com/api/events/types#event_types-balance.available
Once the funds are available, you can create a transfer. This is separate from charge.succeeded
Alternatively, you can use source_transaction parameter while creating a transfer after listening to charge.succeeded
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?
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
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?
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?
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
That's just for checking if funds available for transferring, right? it won't resolve the problem if insufficient funds happens
That's just for checking if funds available for transferring, right?
what are you referring to?
source_transaction
No. If you set source_transaction parameter, the transfer won't fail if there's not enough balance. See: #1288218809165025375 message
The example is in the doc: #1288218809165025375 message
In this case, it won't check fund, but actually the transferred fund will be available after fund available, right?
as long as the connect could receive the amount, it shall be ok, this is a good solution, thanks
NP! 🙂 Happy to help