-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added currency code to fee breakdown when currency symbol is same (#1…
- Loading branch information
Showing
7 changed files
with
182 additions
and
59 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/fix-10006-add-currency-to-fee-details-in-order-note
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Add currency code to fee breakdown when multi-currency is enabled, and currencies share the same symbol. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,55 @@ | ||
{ | ||
"title": "Payment with a foreign card", | ||
"capturedEvent": { | ||
"type": "captured", | ||
"amount": 13000, | ||
"amount_captured": 13000, | ||
"fee": 676, | ||
"fee_rates": { | ||
"percentage": 0.049, | ||
"fixed": 30, | ||
"fixed_currency": "USD", | ||
"history": [ | ||
{ | ||
"type": "base", | ||
"percentage_rate": 0.029, | ||
"fixed_rate": 30, | ||
"currency": "usd" | ||
}, | ||
{ | ||
"type": "additional", | ||
"additional_type": "international", | ||
"percentage_rate": 0.01, | ||
"fixed_rate": 0, | ||
"currency": "usd" | ||
}, | ||
{ | ||
"type": "additional", | ||
"additional_type": "fx", | ||
"percentage_rate": 0.01, | ||
"fixed_rate": 0, | ||
"currency": "usd" | ||
} | ||
] | ||
"title": "Payment with foreign card", | ||
"capturedEvent": | ||
{ | ||
"type": "captured", | ||
"amount": 1800, | ||
"amount_captured": 1800, | ||
"fee": 109, | ||
"fee_rates": { | ||
"percentage": 0.044, | ||
"fixed": 30, | ||
"fixed_currency": "USD", | ||
"history": [ | ||
{ | ||
"type": "base", | ||
"additional_type": "", | ||
"fee_id": "base-us-card-fee", | ||
"percentage_rate": 0.029, | ||
"fixed_rate": 30, | ||
"currency": "usd" | ||
}, | ||
{ | ||
"type": "additional", | ||
"additional_type": "international", | ||
"fee_id": "additional-us-intl-fee", | ||
"percentage_rate": 0.015, | ||
"fixed_rate": 0, | ||
"currency": "usd" | ||
} | ||
] | ||
}, | ||
"currency": "USD", | ||
"datetime": 1736869781, | ||
"deposit": null, | ||
"transaction_id": "txn_3QhCN7R3NO9FvHYd0wKleSrw", | ||
"transaction_details": { | ||
"customer_currency": "USD", | ||
"customer_amount": 1800, | ||
"customer_amount_captured": 1800, | ||
"customer_fee": 109, | ||
"store_currency": "USD", | ||
"store_amount": 1800, | ||
"store_amount_captured": 1800, | ||
"store_fee": 109 | ||
} | ||
}, | ||
"currency": "CAD", | ||
"datetime": 1651997332, | ||
"deposit": null, | ||
"transaction_id": "txn_3Kx5Ae2EFxam75ai0P2BCbp0", | ||
"transaction_details": { | ||
"customer_currency": "CAD", | ||
"customer_amount": 13000, | ||
"customer_amount_captured": 13000, | ||
"customer_fee": 676, | ||
"store_currency": "USD", | ||
"store_amount": 10071, | ||
"store_amount_captured": 10071, | ||
"store_fee": 524 | ||
} | ||
}, | ||
"expectation": { | ||
"fxString": "1.00 CAD → 0.774692 USD: $100.71 USD", | ||
"feeString": "Fee (4.9% + $0.30): -$5.24", | ||
"feeString": "Fee (4.4% + $0.30): -$1.09", | ||
"feeBreakdown": { | ||
"base": "Base fee: 2.9% + $0.30", | ||
"additional-international": "International card fee: 1%", | ||
"additional-fx": "Currency conversion fee: 1%" | ||
"additional-international": "International card fee: 1.5%" | ||
}, | ||
"netString": "Net payout: $95.47 USD" | ||
"netString": "Net payout: $16.91 USD" | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
tests/fixtures/captured-payments/fx-same-currency-symbol.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"title": "FX Payment with a same currency symbol but different currency", | ||
"capturedEvent": | ||
{ | ||
"type": "captured", | ||
"amount": 2400, | ||
"amount_captured": 2400, | ||
"fee": 132, | ||
"fee_rates": { | ||
"percentage": 0.039, | ||
"fixed": 39, | ||
"fixed_currency": "CAD", | ||
"history": [ | ||
{ | ||
"type": "base", | ||
"additional_type": "", | ||
"fee_id": "base-us-card-fee", | ||
"percentage_rate": 0.029, | ||
"fixed_rate": 30, | ||
"currency": "usd" | ||
}, | ||
{ | ||
"type": "additional", | ||
"additional_type": "fx", | ||
"fee_id": "additional-us-card-fx-fee", | ||
"percentage_rate": 0.01, | ||
"fixed_rate": 0, | ||
"currency": "usd" | ||
} | ||
] | ||
}, | ||
"currency": "CAD", | ||
"datetime": 1736871090, | ||
"deposit": null, | ||
"transaction_id": "txn_3QhCiER3NO9FvHYd2DQY4k1S", | ||
"transaction_details": { | ||
"customer_currency": "CAD", | ||
"customer_amount": 2400, | ||
"customer_amount_captured": 2400, | ||
"customer_fee": 132, | ||
"store_currency": "USD", | ||
"store_amount": 1672, | ||
"store_amount_captured": 1672, | ||
"store_fee": 92 | ||
} | ||
}, | ||
"expectation": { | ||
"fxString": "1.00 CAD → 0.696667 USD: $16.72 USD", | ||
"feeString": "Fee (3.9% + $0.39 CAD): -$0.92 USD", | ||
"feeBreakdown": { | ||
"base": "Base fee: 2.9% + $0.30 USD", | ||
"additional-fx": "Currency conversion fee: 1%" | ||
}, | ||
"netString": "Net payout: $15.80 USD" | ||
} | ||
} |