#krishna_awate
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you share the request ID for the API request that returns this error?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_LJrZ07o7kzqLE8
This is a direct charge on a US connected account. Does the connected account have any payment methods activated that work with KZT?
I do not have idea about that sir.
Okay because that is what matters
What will I have to do to enble payement in this currecy.
I'm looking for any payment method that works for this currency
I'm not seeing any so far
Have you been able to accept payments in this currency?
I have used Country Specs api to get currency suupported to US and put those currency in the dropdown to select currecny
There is KZT
So technically it should work.
Have you been able to accept a payment in that currency before?
Hmmm... It is showing as available here: https://stripe.com/docs/currencies?presentment-currency=US#presentment-currencies
I am testing this myself. One thing I noticed is that the amount is too low
We require a minimum charge amount of $0.50 but 15000 in KZT is only $0.34
When I change that amount to 25000 my request succeeds
Yes sir. It is working for me also when increase amount.
Is it mentioned in doc somewhre?
I will file a bug report about that error message
We describe the charge minimum amount in our docs here: https://stripe.com/docs/api/charges/object#charge_object-amount
Okay sir.
I have one more issue.
When I do payment in other currency my platform has to show raised amount in USD
Okay.
Is there any where I can get USD amount while crating paymentIntent
I have to store USD amount in Data base
When I do payment in other currency
I want to see it in USD while creating payemntIntent
We do not have that built into Stripe at the moment
You will need to get the current FX rates from some other API at the time
will it be same to stripe?
Will my amount mis match?
from stripe dashboard to my database when I convert from other API
Unfortunately that is a real possibility since FX rates fluctuate in real time. You might be better off getting the USD amount once the Payment Intent has succeeded.
You can find it on the payment_intent.charge.balance_transaction
For instance, both the Payment Intent and Charge for my test show an amount of 25000 in KZT. But the Balance Transaction (which is when the USD is transferred to my Stripe Account) shows the amount as $0.55
hwo can i get that?
Okay sir.
You would want to wait until the Payment Intent succeeds
And then use the Charge ID to get the Charge from the API
https://stripe.com/docs/api/charges/retrieve
and include balance_transaction in the expand parameter. This will return the full Balance Transaction as part of the Charge instead of just the ID
where can I get that charge id.
So I will have to save it.
Or you can listen to the payment_intent.payment_succeeded webhook event and look up the Charge and Balance Transaction then. The webhook event will include the Payment Intent object with the Charge ID.
But either approach would work
Happy to do it ๐ it's why we are here.
Can you share the ID as text so I can look up the Payment Intent?
pi_3NbQw8DBfYojrB0W0CEcZ3GR
This payment has not succeeded yet. They need to be paid first
Then how can I get payment intent
That won't have any charge or balance transaction associated with it yet. The customer has to pay it first
That is what I said earlier
and I explained how you could look up the Payment Intent after it succeeds
If I do not want to go for webhooks.
Then there is the only way to get payment intent.
You would need to wait until the charge succeeds or you can't get the charge or balance transaction
Okay. If charge succed then how can I search for payemnt intent?
Do I have to save it?
If you are not using webhooks then I would recommend saving the Payment Intent ID https://stripe.com/docs/api/payment_intents/retrieve
How are the customers providing funds?
Are you coding the front-end?
Are you using the Stripe Card Element or Payment Element to confirm the Payment Intent?
payment element
Okay great. So when you call .confirmPayment() on the client-side it will either return an {error} or be successful. At this point your client can send a request back to your server to indicate if the Payment Intent has succeeded. You can send the client_secret you used to create the Payment Element back to the server and use that to look up the Payment Intent
- confirmPayment: https://stripe.com/docs/js/payment_intents/confirm_payment
You can retrieve the whole Payment Intent on the client-side if you want but I generally prefer to keep the client-side pretty dumb and put all the important code in the server-side
I am passing client secret. Do I need to pass payment intent.
The client secret will identify the Payment Intent. You can use it server-side to look up the Payment Intent. We show that here:
https://stripe.com/docs/api/payment_intents/retrieve#retrieve_payment_intent-client_secret
Then again I will have to retrieve payment intent.
I already have payment Intent in frontend
I can directly pass. so I won't nee to identify payent intent.
Okay, if that is easier for you
Nice!
message: "No such charge: 'ch_3NbRReDBfYojrB0W1GbIEoKs'",
When doing
const charge = await stripe.charges.retrieve(
paymentIntent.latest_charge
);
That is because it exists on the Connected Account. You need to make the request with the Stripe Account header
const charge = await stripe.charges.retrieve(
paymentIntent.latest_charge,
{},
{
stripeAccount: bank_info.stripe_account_id,
}
);
like above?
Yes
We have an example here: https://stripe.com/docs/api/connected_accounts?lang=node
where can I see USD amoun?
In the Balance Transaction
The Charge Object has a balance_transaction property that contains the ID of the balance transaction.
I told you earlier to pass it in the expand parameter when getting the Charge so you didn't need to make two API calls
Yes
Yes that's it
Sorry I did not get it
NP. For now you can use that txn_ ID to look up the Balance Transaction: https://stripe.com/docs/api/balance_transactions/retrieve
Yes, using the expand parameter which is what I explained earlier
Please read this doc: https://stripe.com/docs/expand
const charge = await stripe.charges.retrieve(
paymentIntent.latest_charge,
{
stripeAccount: bank_info.stripe_account_id,
},
{
expand: ['payment_intent.payment_method'],
}
);
not able to understand what to add in array
๐ hopping in here to help
Hello sir.
Did you read the doc on expansion that snufkin_stripe sent out? It gives pretty detailed explanations on how to do expansion
I am not able to udrstand how to
Yes I went throgh it
but what to add in that array.
You have to expand balance_transaction and you're making a LIST call, so you'd expand data.balance_transaction
Is it same
YOu should test it out and see if it behaves olike you expect
giving error
Error: Stripe: Unknown arguments ([object Object],[object Object]). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to GET /charges/{charge})
Hello
Did you read the link that error message sends you to?
I'm here to help, but you also need to be reading and understanding the links we send to you
You're passing in your arguments in the wrong order
If you looked at our SDK you'd see that the retrieve expects them in this order:
- ID
- request params (like expand)
- options (like the stripe account header)
We explain all this in the expansion doc that was sent
We go into multi-level, how to do this with lists, everything
Please read the doc and ask if you have specific questions on what you read
Yes sir. I did it.
Thank you so much for your help.
Sir I have one doubt
If my accont is Indian based then which currency will be my final settlement?
If you have an indian account then you'd settle in INR
And will I get balance transaction in same currency?
Yes a Singapore account would settle in their currency
Only exception to this would be if you had multiple bank accounts for payouts (https://stripe.com/docs/payouts#multiple-bank-accounts)
But I believe both Singapore and Indian are limited to only supporting their own settlement currency
If you have more questions on this I'd recommend reading this doc (https://stripe.com/docs/connect/currencies), testing out the flow end to end, and then talking to support if you have any more questions
You'll see balance transactions in the currency that you're settling in
you too!