mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-26 11:14:11 +01:00
Cw 1611 fetch moon pay payment methods from their api (#3565)
* add payment method api * add payment method limits * Update lib/buy/moonpay/moonpay_provider.dart * fix MoonPay payment method handling * Handle custom MoonPay payment methods * fix limits when max is infinite [skip ci] --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -91,13 +91,15 @@ class BuySellConfirmationPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
if (buySellViewModel.selectedQuote!.paymentType.title?.isNotEmpty ??
|
||||
false)
|
||||
if (buySellViewModel.selectedQuote!.paymentType.title?.isNotEmpty
|
||||
?? buySellViewModel.selectedQuote!.customPaymentMethodType?.isNotEmpty
|
||||
?? false)
|
||||
ListItemRegularRow(
|
||||
showArrow: false,
|
||||
keyValue: "payment method",
|
||||
label: S.of(context).payment_method,
|
||||
trailingText: buySellViewModel.selectedQuote!.paymentType.title,
|
||||
trailingText: buySellViewModel.selectedQuote!.paymentType.title
|
||||
?? buySellViewModel.selectedQuote!.customPaymentMethodType,
|
||||
),
|
||||
ListItemRegularRow(
|
||||
showArrow: false,
|
||||
@@ -105,6 +107,13 @@ class BuySellConfirmationPage extends StatelessWidget {
|
||||
label: S.of(context).rate,
|
||||
trailingText: buySellViewModel.selectedQuote!.topLeftSubTitle,
|
||||
),
|
||||
if (_limitsText != null)
|
||||
ListItemRegularRow(
|
||||
showArrow: false,
|
||||
keyValue: "limits",
|
||||
label: "Limits",
|
||||
trailingText: _limitsText,
|
||||
),
|
||||
],
|
||||
},
|
||||
),
|
||||
@@ -127,6 +136,14 @@ class BuySellConfirmationPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
|
||||
String? get _limitsText {
|
||||
final limits = buySellViewModel.selectedQuote?.limits;
|
||||
final max = limits?.max;
|
||||
if (limits == null || max == null || max == double.infinity) return null;
|
||||
|
||||
return "${limits.min ?? 0} - $max";
|
||||
}
|
||||
|
||||
String get _pageTitle =>
|
||||
"${buySellViewModel.mode == BuySellPageMode.buy ? S.current.buy : S.current.sell} ${buySellViewModel.cryptoCurrency.fullName ?? ""}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user