#krishna_awate

1 messages ยท Page 1 of 1 (latest)

pulsar gateBOT
patent cobalt
sand eagle
#

req_LJrZ07o7kzqLE8

patent cobalt
#

This is a direct charge on a US connected account. Does the connected account have any payment methods activated that work with KZT?

sand eagle
#

I do not have idea about that sir.

patent cobalt
#

Okay because that is what matters

sand eagle
#

What will I have to do to enble payement in this currecy.

patent cobalt
#

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?

sand eagle
#

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.

patent cobalt
#

Have you been able to accept a payment in that currency before?

sand eagle
#

No.

#

This is first time.

#

Some other currency also have same issue.

patent cobalt
sand eagle
#

How I am getting this error.

#

CRC currency also have same issue.

patent cobalt
#

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

sand eagle
#

Yes sir. It is working for me also when increase amount.

sand eagle
patent cobalt
#

I will file a bug report about that error message

sand eagle
#

Okay sir.

#

I have one more issue.

#

When I do payment in other currency my platform has to show raised amount in USD

patent cobalt
#

Right

#

Because that is the settlement currency for your platform

sand eagle
#

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

patent cobalt
#

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

sand eagle
#

will it be same to stripe?

#

Will my amount mis match?

#

from stripe dashboard to my database when I convert from other API

patent cobalt
#

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

patent cobalt
#

2 ways.

#

Wait.

sand eagle
#

Okay sir.

patent cobalt
#

You would want to wait until the Payment Intent succeeds

sand eagle
#

where can I get that charge id.

patent cobalt
#

It is returned on the Payment Intent.

#

payment_intent.latest_charge

sand eagle
#

So I will have to save it.

patent cobalt
#

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

sand eagle
#

Okay sir. Got it.

#

Thank you so much for your help

patent cobalt
#

Happy to do it ๐Ÿ™‚ it's why we are here.

sand eagle
#

Yes sir. Have a great day.

#

Sorry but I am getting latest charge null

patent cobalt
#

Can you share the ID as text so I can look up the Payment Intent?

sand eagle
#

pi_3NbQw8DBfYojrB0W0CEcZ3GR

patent cobalt
#

This payment has not succeeded yet. They need to be paid first

sand eagle
#

Then how can I get payment intent

patent cobalt
#

What do you mean?

#

When are you trying to get the Payment Intent?

sand eagle
#

here

patent cobalt
#

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

sand eagle
#

If I do not want to go for webhooks.

#

Then there is the only way to get payment intent.

patent cobalt
#

You would need to wait until the charge succeeds or you can't get the charge or balance transaction

sand eagle
#

Okay. If charge succed then how can I search for payemnt intent?

#

Do I have to save it?

patent cobalt
#

How are the customers providing funds?

#

Are you coding the front-end?

sand eagle
#

Yes.

#

using front-end.

patent cobalt
#

Are you using the Stripe Card Element or Payment Element to confirm the Payment Intent?

sand eagle
#

payment element

patent cobalt
#

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

sand eagle
#

Exactly sir !

#

I was looking same code

patent cobalt
#

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

sand eagle
#

I am passing client secret. Do I need to pass payment intent.

patent cobalt
sand eagle
#

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.

patent cobalt
#

Okay, if that is easier for you

sand eagle
#

Yes sir. Give me a moment

#

I will try

#

Now I got latest charge

patent cobalt
#

Nice!

sand eagle
#

message: "No such charge: 'ch_3NbRReDBfYojrB0W1GbIEoKs'",

#

When doing

#

const charge = await stripe.charges.retrieve(
paymentIntent.latest_charge
);

patent cobalt
#

That is because it exists on the Connected Account. You need to make the request with the Stripe Account header

sand eagle
#

const charge = await stripe.charges.retrieve(
paymentIntent.latest_charge,
{},
{
stripeAccount: bank_info.stripe_account_id,
}
);

#

like above?

patent cobalt
#

Yes

sand eagle
#

where can I see USD amoun?

patent cobalt
#

In the Balance Transaction

#

The Charge Object has a balance_transaction property that contains the ID of the balance transaction.

sand eagle
patent cobalt
#

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

sand eagle
#

Yes

patent cobalt
#

Yes that's it

patent cobalt
pulsar gateBOT
sand eagle
#

Can I reduce two api calls

#

?

patent cobalt
#

Yes, using the expand parameter which is what I explained earlier

sand eagle
#

Can you reply on that?

#

I am not able to see it.

patent cobalt
sand eagle
#

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

barren cradle
#

๐Ÿ‘‹ hopping in here to help

sand eagle
#

Hello sir.

barren cradle
#

Did you read the doc on expansion that snufkin_stripe sent out? It gives pretty detailed explanations on how to do expansion

sand eagle
#

I am not able to udrstand how to

#

Yes I went throgh it

#

but what to add in that array.

barren cradle
#

You have to expand balance_transaction and you're making a LIST call, so you'd expand data.balance_transaction

sand eagle
#

Is it same

barren cradle
#

Ah sorry it's not a list request I misread

#

It should just be balance_transaction

sand eagle
#

Okay sir No problem

#

Is it okay.

barren cradle
#

YOu should test it out and see if it behaves olike you expect

sand eagle
#

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})

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

#

Hello

barren cradle
#

Did you read the link that error message sends you to?

sand eagle
#

Sorry but I didn;t get it

#

Can you please help me.

barren cradle
#

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)
sand eagle
#

got it

#

Can I expand in payment intent

#

mulitple level

barren cradle
#

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

sand eagle
#

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?

barren cradle
#

If you have an indian account then you'd settle in INR

sand eagle
#

Is it same for Singapore also

#

Singapore Dollar.

sand eagle
barren cradle
#

Yes a Singapore account would settle in their currency

#

But I believe both Singapore and Indian are limited to only supporting their own settlement currency

sand eagle
#

Just last question sir.

#

will I get balance transaction in same currency?

#

from this

barren cradle
#

You'll see balance transactions in the currency that you're settling in

sand eagle
#

Okay thank you so much sir for your help.

#

Have a great day

#

Bye.

barren cradle
#

you too!