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:
Serhii
2026-10-08 13:02:51 +02:00
committed by GitHub
co-authored by Omar Hatem
parent a5dc3a4add
commit 37ef179f6e
8 changed files with 319 additions and 235 deletions
@@ -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 ?? ""}";