|
@@ -88,13 +88,13 @@ class PaymentsRelationManager extends RelationManager
|
88
|
88
|
|
89
|
89
|
$invoiceCurrency = $ownerRecord->currency_code;
|
90
|
90
|
|
91
|
|
- if (! CurrencyConverter::isValidAmount($state, $invoiceCurrency)) {
|
|
91
|
+ if (! CurrencyConverter::isValidAmount($state, 'USD')) {
|
92
|
92
|
return null;
|
93
|
93
|
}
|
94
|
94
|
|
95
|
95
|
$amountDue = $ownerRecord->getRawOriginal('amount_due');
|
96
|
96
|
|
97
|
|
- $amount = CurrencyConverter::convertToCents($state, $invoiceCurrency);
|
|
97
|
+ $amount = CurrencyConverter::convertToCents($state, 'USD');
|
98
|
98
|
|
99
|
99
|
if ($amount <= 0) {
|
100
|
100
|
return 'Please enter a valid positive amount';
|
|
@@ -135,7 +135,7 @@ class PaymentsRelationManager extends RelationManager
|
135
|
135
|
$invoice = $livewire->getOwnerRecord();
|
136
|
136
|
$invoiceCurrency = $invoice->currency_code;
|
137
|
137
|
|
138
|
|
- if (empty($amount) || empty($bankAccountId) || ! CurrencyConverter::isValidAmount($amount, $invoiceCurrency)) {
|
|
138
|
+ if (empty($amount) || empty($bankAccountId) || ! CurrencyConverter::isValidAmount($amount, 'USD')) {
|
139
|
139
|
return null;
|
140
|
140
|
}
|
141
|
141
|
|
|
@@ -152,7 +152,7 @@ class PaymentsRelationManager extends RelationManager
|
152
|
152
|
}
|
153
|
153
|
|
154
|
154
|
// Convert amount from invoice currency to bank currency
|
155
|
|
- $amountInInvoiceCurrencyCents = CurrencyConverter::convertToCents($amount, $invoiceCurrency);
|
|
155
|
+ $amountInInvoiceCurrencyCents = CurrencyConverter::convertToCents($amount, 'USD');
|
156
|
156
|
$amountInBankCurrencyCents = CurrencyConverter::convertBalance(
|
157
|
157
|
$amountInInvoiceCurrencyCents,
|
158
|
158
|
$invoiceCurrency,
|