#stephy
1 messages · Page 1 of 1 (latest)
hi there, can you share the request id [0] where you're seeing the error? it'd look like req_xxx
those funds are still in your pending balance
what you would want to do when creating the Transfer is to include the corresponding Charge id in the source_transaction parameter : https://stripe.com/docs/api/transfers/create#create_transfer-source_transaction
The main point to remember is that when using source_transaction, if the payment is still pending, then the transfer will pull the funds from the pending balance. If the payment is already available, then the transfer will pull the funds from the available balance.
if you don't specify the source_transaction, it'll always try to use the funds from your available balance and if the payment funds is not yet available, and you don't specify the source_transaction then you run into the problem of insufficient funds
So I have to create source_transaction?
include the corresponding Charge id in the source_transaction parameter : https://stripe.com/docs/api/transfers/create#create_transfer-source_transaction when creating the Transfer
How to charge ?which api used for this??
when a PaymentIntent is successful, there will be a Charge id e.g. for pi_3NBX5zEZ1Pyl4W3k0wadWYt5, the corresponding charge id is ch_3NBX5zEZ1Pyl4W3k0dF3TXgG - you can view your request and response in https://dashboard.stripe.com/test/logs/req_8NXdl0YpsakM2S.
req_4cTZjanU13n7II
what's your question?
When I use payment intent I got a error
have you take a look at that request in your Dashboard and seen what's the error message?
Yes
They ask me to create payment method
I created that also again get error
Shall I explain my issue and requirement?
I create a connected account and I need to transfer the money for the account...to do this I create a transfer api but when using that I got an error that you have insufficient balance...
This is what am facing ... yesterday only I do my first transaction to this stripe account for testing
$paymentIntent = PaymentIntent::create([
'amount' => $amount * 100, // Amount in cents (e.g., $10.00)
'currency' => 'usd',
'payment_method_types' => ['card'],
]);
// Create a payment method
$paymentMethod = $paymentIntent->payment_method;
// Attach the payment method to the PaymentIntent
$paymentIntent->payment_method = $paymentMethod;
$paymentIntent->save();
// Confirm the PaymentIntent
$paymentIntent->confirm();
// Retrieve the charge ID
$chargeId = $paymentIntent->charges->data[0]->id;
This what am used
can you share more on why you're trying to create a PaymentIntent again? Is there a reason why you can't use the charge id ch_3NBX5zEZ1Pyl4W3k0dF3TXgG which i provided to pass into the the source_transaction parameter when creating the Transfer?
So I can use this charge I'd manually????
maybe you'd want to try it out?
Yes tried
I got both source type and source transaction not use
Yes it's successful
So if am going to live mode then what are the changes I have to do? Is I have to remove the charge id that you provided?
maybe let me ask a different question to understand what's your business scenario first - are you collecting payment, then always transferring money from that payment to a single connected account?
Am collecting money from the customers and transfer the money to vendors connected accounts ..so there is multiple vendor accounts
so every time you transfer - you should identify which PaymentIntent and pass the corresponding charge id into the source_transaction parameter when creating the Transfer
How to create that payment intent ? When i tried I got error so I don't what mistake I done to create that
you didn't pass in a payment_method id
Not understand
examine your PaymentIntent - does it have any payment_method? https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method
I my payment intent I gave 3 parameter amount currency and payment method type
payment_method_type and payment_method are two entirely different parameters
i suggest going through the API reference for PaymentIntents
Ok I got it.. automatic_payment_methdos should be added right?
how are you collecting the payment method details e.g. card number, card expiry, cvc?
Now I developed card only ..but also going to develop ach direct debit also
yes, but how are you collecting the card details from your customers?
yes, but how are you collecting these card details from your customers?
For that am using payment_method api
i.e. is your customer going to type these information into an input field on your website?
Yes
are you using a Stripe Element to collect those information e.g. the Payment Element?
But this transfer section not doing in customer side..this transfer api used to transfer the amount from owner account to connected accounts
without payments, how are you going to get the money to transfer to your connected accounts?
Payment is collected from customers...to do that we developed a stripe card where we entered the card number cvc etc details...and I done that through which yesterday I made my first transaction ..and my account is credited that amount ..and today I create a connected account and tried to transfer money to that then I shows this insufficient balance error
lets go back to your first step first of collecting payment from your customers first - Are you using Stripe elements to collect those payment method details or your own input fields?
We create a custom form to enter these card details and using stripe api payment method , payment intent to do further
In payment method api ,we pass all card info
To be clear, if you collect raw credit card numbers in your custom form and then use the Stripe API directly to tokenize the cards, you become subject to the full PCI compliance standards. In your case this means you’d have to submit a SAQ D form annually to prove that you are PCI compliant [0]. It’s a 40 page form and typically, not a headache most people want to be dealing with.
If you don't want to deal with that, you should use Stripe Elements e.g. Checkout Sessions, or Payment Elements to collect payment method details instead
[0] see https://stripe.com/docs/security/guide#validating-pci-compliance under "API Direct" as this is what your integration would be classified as.
Why should I face these insufficient balance issue after having balance ?
Is it because I do the transaction yesterday? May be that y the fund not credited to my account?
To work my transfer I use one api also...If you don't mind can you tell if any issue that am using i. This way
$charge = \Stripe\Charge::create([
'amount' => $amount * 100, // Amount in cents (e.g., $10.00)
'currency' => 'usd',
'source' => 'tok_visa', // Replace with a valid payment source token or payment method ID
'description' => 'Example Charge',
]);
$transfer = Transfer::create([
'amount' => $amount * 100, // Amount in cents (e.g., $10.00)
'currency' => 'usd',
// 'source_type' => 'card',
'destination' => $connected_account->account_id, // Replace with the ID of the destination account
'description' => 'Transfer from Telgy',
'source_transaction' => $charge->id
]);
you shouldn't be using the Charge API - you should be using PaymentIntents. When the PaymentIntent is successful, there will be a charge id
like i mentioned previously, the PaymentIntent didn't have a payment_method when you confirmed it
Ok...so there is another question... If my account have enough amount ..then if it's need to give this payment intent?
And in payment I see I'd like pi_3Nab like
Not ch_xxx like
And using that I'd in source transaction I got error
How can I get charge I'd from this????
can you provide the PaymentIntent id?
"pi_3NBYP3EZ1Pyl4W3k0mybyeWO",
There is no Charge associated with that Payment Intent – it's in a requires_confirmation state (you didn't pass confirm: true when creating it: https://dashboard.stripe.com/test/logs/req_abzyETWhyx9suI)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Ok I understand
Using charge Id my transaction is done
There is another doubt ..if am going to live mode then what are the changes that I need to do?
Generally you'd just need to swap our your API keys to the live ones (sk_live_xxx, pk_live_xxx)
So I have another question
As per my requirement I want to transfer the amount from my stripe account to vendors connected accounts...so now I create a payment method where am giving test dummy card info and then create payment intent and the. Tranfer api So is this correct?
Using this can I transfer my account money to my connected accounts?
My site payment flow is like ....there i collect the money from customers and after credit the money I will transfer the money to vendor this is actually want
So I got an error insufficient balance that why I create this payment intent and averything
Seems right so far
When did you get this error?
Without using this payment intent and payment method I give transfer api and also give source type as card then I got this error
Sure, seems expected if your platform balance doesn't cover the transfer amount
If I charge the amount in today can i transfer the amount today itself? Or it take some time to credit... because my card have balance then also it's shows this insufficient balance so it's much confusing
Sure payments can take time to be available in your balance, that's how things generally work. If you need immediate balance, use the test cards here when making your payments: https://stripe.com/docs/testing#available-balance
Yes am using test card
You need to use the specific test cards I just linked
That will credit your platform balance immediately, then you can transfer without the 'insufficient balance' error
4242424242424242 these i used
Great, now try and create the Transfer as you were before (it shouldn't error now)
So not need to use the payment intent now right?
Nope
Thank you so much it's working ❤️❤️❤️