Fix FX conversion for Tremendous methods (#5268)
This commit is contained in:
@@ -90,6 +90,11 @@ pub(super) async fn create(
|
|||||||
);
|
);
|
||||||
let net_usd = gross_usd - total_fee_usd;
|
let net_usd = gross_usd - total_fee_usd;
|
||||||
|
|
||||||
|
let net_local = net_usd.mul_round(
|
||||||
|
usd_to_currency,
|
||||||
|
RoundingStrategy::MidpointTowardZero,
|
||||||
|
);
|
||||||
|
|
||||||
Ok(PayoutFlow {
|
Ok(PayoutFlow {
|
||||||
net_usd,
|
net_usd,
|
||||||
total_fee_usd,
|
total_fee_usd,
|
||||||
@@ -105,8 +110,8 @@ pub(super) async fn create(
|
|||||||
// To offset this, we (the platform) take the fees off before
|
// To offset this, we (the platform) take the fees off before
|
||||||
// we send the request to Tremendous. Afterwards, the method
|
// we send the request to Tremendous. Afterwards, the method
|
||||||
// (Tremendous) will take 0% off the top of our $10.
|
// (Tremendous) will take 0% off the top of our $10.
|
||||||
value_denomination: net_usd.get(),
|
value_denomination: net_local.get(),
|
||||||
value_currency_code: TremendousCurrency::Usd.to_string(),
|
value_currency_code: currency_code,
|
||||||
net_usd,
|
net_usd,
|
||||||
total_fee_usd,
|
total_fee_usd,
|
||||||
delivery_email,
|
delivery_email,
|
||||||
|
|||||||
Reference in New Issue
Block a user