#costia - test mode
1 messages ยท Page 1 of 1 (latest)
hey can you say a bit more what you mean? are you referring to the payment amount staying in your pending balance?
Oh sorry i'm french so sometimes its difficult to explain what I means .
So i create a system to pay with this :
stripe.paymentIntents.create({
amount: Math.floor(amount),
currency: "EUR",
description: 'Thats just a test',
payment_method: paymentMethod,
confirm: true
})
and after i want to transfer like this :
const transfer = await stripe.transfers.create({
amount: Math.floor((amount*85)/100),
currency: 'eur',
destination: docs.stripeId,
});
but when i try to transfer i have an error :
StripeInvalidRequestError: You have insufficient funds in your Stripe account
So i'm asking if when we are in test mode the payment aren't add to wallet
On the platform, use a test card like 4000000000000077 which skips the pending balance and is made available immediately, then you can use the funds with a transfer
The top two cards here: https://stripe.com/docs/testing#cards-responses
hummmm okay so that will be a problem if my customers's payments have a pending time
Well yes, this is just regarding test mode
For real payments, there is another option of linking the transfer to the source_transaction:
you're welcome, and you too!
thanks i have an other question i have this error when i use the source_transaction with paymentIntents id :
StripeInvalidRequestError: No such charge: 'pi_3KEaWUGmJ5WnHwdA0P8N9Iui'
did i have to replace stripe.paymentIntents.create method to stripe.charges.create ?
No you should still use payment intents, but you'll need the underlying charge reference from the payment intent:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i don't really understand but i will try ty ๐
Let me know if I can help clarify! payment intents use charges under the hood (think of them like a stateful wrapper around a payment). For this specific scenario you need to provide a reference to that charge.