#memeky-paymentintent-exchangerate
1 messages · Page 1 of 1 (latest)
i use php
Hi there! No, this isn't possible. You can use this page to estimate currency conversion: https://dashboard.stripe.com/currency_conversion
the actual exchange rate used for a given transaction will be visible in the balance transaction object: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-exchange_rate
that is, from a paymentintent, can I get a conversion?
I can't understand this part well, could you please give me a code example here I would be very grateful
If you have a PaymentIntent, you can grab its latest_charge, then look up that charge and expand the balance_transaction to inspect the exchange_rate: https://stripe.com/docs/api/charges/object#charge_object-balance_transaction
I have this code to know when I will have available the funds that a colleague of yours helped me to get
$paymentIntentTxn = \Stripe\PaymentIntent::retrieve([
'id' => $PI,
'expand' => ['latest_charge.balance_transaction'],
]);
$fui = $paymentIntentTxn -> latest_charge -> balance_transaction -> available_on;
$hora = gmdate("Y-m-d", $fui);
1:
$paymentIntent = $stripe->paymentIntents->create([
'customer' => $customer->id,
'amount' => $planPriceCents,
'currency' => $currency,
'payment_method_types' =>['card'],
'description' =>$referencia
]);
and I would be missing the second step if you could help me get it out
I'm not sure what you mean by second step? # 1 above is purely the creation of the PaymentIntent
Now from this PaymentIntent I have to get the balance_transactio and exchange_rate ?
simulate a paymentintent and thus I get the exchange_rate of a fictitious purchase
Or how do I get the exchange rate between currencies?
I have four currencies CHF, EUR, USD and GBP
and I have connected accounts and sometimes they have paid me in euros and I have to deposit the money in a connected account in dollars or another currency
@open ruin I see that you are alone and you have a lot of work to do. We leave it for another day. I don't want to burden you anymore. Customer service is difficult, I understand it. Cheer up, you can do it 🙂 !! gg