From 8a1eee204b8ea2132ff499ebaf75621369f4562a Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 19 Jan 2023 17:47:27 -0600 Subject: [PATCH] purchaseId -> id because SimplexOrder qill have a quoteId, paymentId, and userId... --- lib/models/buy/response_objects/quote.dart | 4 ++-- lib/models/buy/simplex/simplex.dart | 2 +- lib/pages/buy_view/buy_form.dart | 8 ++++---- lib/pages/buy_view/buy_quote_preview.dart | 2 +- lib/services/buy/simplex/simplex_api.dart | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/models/buy/response_objects/quote.dart b/lib/models/buy/response_objects/quote.dart index e2993156b..f384894a4 100644 --- a/lib/models/buy/response_objects/quote.dart +++ b/lib/models/buy/response_objects/quote.dart @@ -11,7 +11,7 @@ class SimplexQuote { late final Decimal youPayFiatPrice; late final Decimal youReceiveCryptoAmount; - late final String purchaseId; + late final String id; late final String receivingAddress; late final bool buyWithFiat; @@ -21,7 +21,7 @@ class SimplexQuote { required this.fiat, required this.youPayFiatPrice, required this.youReceiveCryptoAmount, - required this.purchaseId, + required this.id, required this.receivingAddress, required this.buyWithFiat}); } diff --git a/lib/models/buy/simplex/simplex.dart b/lib/models/buy/simplex/simplex.dart index 3c47f327e..648b368d7 100644 --- a/lib/models/buy/simplex/simplex.dart +++ b/lib/models/buy/simplex/simplex.dart @@ -13,7 +13,7 @@ class Simplex { {'ticker': 'USD', 'name': 'United States Dollar', 'image': ''}), youPayFiatPrice: Decimal.parse("100"), youReceiveCryptoAmount: Decimal.parse("1.0238917"), - purchaseId: "someID", + id: "someID", receivingAddress: '', buyWithFiat: true, ); diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index c422525ad..d61714d9c 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -79,7 +79,7 @@ class _BuyFormState extends ConsumerState { {'ticker': 'USD', 'name': 'United States Dollar', 'image': ''}), youPayFiatPrice: Decimal.parse("100"), youReceiveCryptoAmount: Decimal.parse("1.0238917"), - purchaseId: "someID", + id: "someID", receivingAddress: '', buyWithFiat: true, ); // TODO enum this or something @@ -333,7 +333,7 @@ class _BuyFormState extends ConsumerState { } Future previewQuote(SimplexQuote quote) async { - // if (ref.read(simplexProvider).quote.purchaseId == "someID") { + // if (ref.read(simplexProvider).quote.id == "someID") { // // TODO make a better way of detecting a default SimplexQuote bool shouldPop = false; unawaited( @@ -358,7 +358,7 @@ class _BuyFormState extends ConsumerState { youReceiveCryptoAmount: buyWithFiat ? Decimal.parse("0.000420282") // dummy value : Decimal.parse(_buyAmountController.text), // Ternary for this - purchaseId: "purchaseId", // anything; we get an ID back + id: "id", // anything; we get an ID back receivingAddress: _receiveAddressController.text, buyWithFiat: buyWithFiat, ); @@ -485,7 +485,7 @@ class _BuyFormState extends ConsumerState { {'ticker': 'USD', 'name': 'United States Dollar', 'image': ''}), youPayFiatPrice: Decimal.parse("100"), youReceiveCryptoAmount: Decimal.parse("1.0238917"), - purchaseId: "someID", + id: "someID", receivingAddress: '', buyWithFiat: true, ); // TODO enum this or something diff --git a/lib/pages/buy_view/buy_quote_preview.dart b/lib/pages/buy_view/buy_quote_preview.dart index ed1d1b1a5..798a3f530 100644 --- a/lib/pages/buy_view/buy_quote_preview.dart +++ b/lib/pages/buy_view/buy_quote_preview.dart @@ -162,7 +162,7 @@ class _BuyQuotePreviewViewState extends State { style: STextStyles.label(context), ), Text( - widget.quote.purchaseId, + widget.quote.id, style: STextStyles.label(context).copyWith( color: Theme.of(context).extension()!.textDark, ), diff --git a/lib/services/buy/simplex/simplex_api.dart b/lib/services/buy/simplex/simplex_api.dart index b14513376..5ac75f6a6 100644 --- a/lib/services/buy/simplex/simplex_api.dart +++ b/lib/services/buy/simplex/simplex_api.dart @@ -150,7 +150,7 @@ class SimplexAPI { fiat: quote.fiat, youPayFiatPrice: quote.youPayFiatPrice, youReceiveCryptoAmount: Decimal.parse(cryptoAmount), - purchaseId: jsonArray['quote_id'] as String, + id: jsonArray['quote_id'] as String, receivingAddress: quote.receivingAddress, buyWithFiat: quote.buyWithFiat, );