From f59e23766955fb11ff610115d202ff4b8bce0cc4 Mon Sep 17 00:00:00 2001 From: ppatidar2021 <89529106+ppatidar2021@users.noreply.github.com> Date: Tue, 26 Oct 2021 20:30:36 +0530 Subject: [PATCH] #v4.1.2110.0-rc - Added missing properties in models (#82) --- BitPay/Models/Invoice/Invoice.cs | 55 ++++++++++++++++++- .../Invoice/InvoiceBuyerProvidedInfo.cs | 2 + BitPay/Models/Payout/PayoutInstruction.cs | 5 +- BitPay/Models/Settlement/PayoutInfo.cs | 21 ++++++- BitPayUnitTest/BitPayTest.cs | 8 +-- 5 files changed, 84 insertions(+), 7 deletions(-) diff --git a/BitPay/Models/Invoice/Invoice.cs b/BitPay/Models/Invoice/Invoice.cs index 90d04b8..326568d 100644 --- a/BitPay/Models/Invoice/Invoice.cs +++ b/BitPay/Models/Invoice/Invoice.cs @@ -74,6 +74,15 @@ public string Currency [JsonProperty(PropertyName = "fullNotifications")] public bool FullNotifications { get; set; } + [JsonProperty(PropertyName = "autoRedirect")] + public bool AutoRedirect { get; set; } + + [JsonProperty(PropertyName = "nonPayProPaymentReceived")] + public bool NonPayProPaymentReceived { get; set; } + + [JsonProperty(PropertyName = "jsonPayProRequired")] + public bool JsonPayProRequired { get; set; } + [JsonProperty(PropertyName = "extendedNotifications")] public bool ExtendedNotifications { get; set; } @@ -116,6 +125,10 @@ public string Currency public int TargetConfirmations { get; set; } + public int UnderpaidAmount { get; set; } + + public int OverpaidAmount { get; set; } + public List Transactions { get; set; } public string ExceptionStatus { get; set; } @@ -146,6 +159,10 @@ public dynamic RefundAddresses public double AmountPaid { get; set; } + public string DisplayAmountPaid { get; set; } + + public string CloseURL { get; set; } + public dynamic ExchangeRates { get => _exchangeRates; @@ -187,6 +204,11 @@ public bool ShouldSerializeFullNotifications() return FullNotifications; } + public bool ShouldSerializeAutoRedirect() + { + return AutoRedirect; + } + public bool ShouldSerializeExtendedNotifications() { return ExtendedNotifications; @@ -267,6 +289,7 @@ public bool ShouldSerializeAmountPaid() return false; } + public bool ShouldSerializePaymentTotals() { return false; @@ -332,6 +355,16 @@ public bool ShouldSerializeTargetConfirmations() return false; } + public bool ShouldSerializeUnderpaidAmount() + { + return false; + } + + public bool ShouldSerializeOverpaidAmount() + { + return false; + } + public bool ShouldSerializeTransactions() { return false; @@ -347,6 +380,16 @@ public bool ShouldSerializeRefundAddresses() return false; } + public bool ShouldSerializeNonPayProPaymentReceived() + { + return false; + } + + public bool ShouldSerializeJsonPayProRequired() + { + return false; + } + public bool ShouldSerializeRefundAddressRequestPending() { return false; @@ -361,5 +404,15 @@ public bool ShouldSerializeBuyerProvidedInfo() { return false; } + + public bool ShouldSerializeDisplayAmountPaid() + { + return !string.IsNullOrEmpty(DisplayAmountPaid); + } + + public bool ShouldSerializeCloseURL() + { + return !string.IsNullOrEmpty(CloseURL); + } } -} \ No newline at end of file +} diff --git a/BitPay/Models/Invoice/InvoiceBuyerProvidedInfo.cs b/BitPay/Models/Invoice/InvoiceBuyerProvidedInfo.cs index 4e39b31..5079caa 100644 --- a/BitPay/Models/Invoice/InvoiceBuyerProvidedInfo.cs +++ b/BitPay/Models/Invoice/InvoiceBuyerProvidedInfo.cs @@ -9,6 +9,8 @@ public class InvoiceBuyerProvidedInfo public string EmailAddress { get; set; } + public string SelectedWallet { get; set; } + public string SetSelectedTransactionCurrency { get; set; } } } diff --git a/BitPay/Models/Payout/PayoutInstruction.cs b/BitPay/Models/Payout/PayoutInstruction.cs index b2e8526..ff78384 100644 --- a/BitPay/Models/Payout/PayoutInstruction.cs +++ b/BitPay/Models/Payout/PayoutInstruction.cs @@ -53,6 +53,9 @@ public PayoutInstruction(double amount, int method, string methodValue) [JsonProperty(PropertyName = "email")] public string Email { get; set; } + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + [JsonProperty(PropertyName = "recipientId")] public string RecipientId { get; set; } @@ -126,4 +129,4 @@ public bool ShouldSerializeWalletProvider() return !string.IsNullOrEmpty(WalletProvider); } } -} \ No newline at end of file +} diff --git a/BitPay/Models/Settlement/PayoutInfo.cs b/BitPay/Models/Settlement/PayoutInfo.cs index 19b563d..1b492c7 100644 --- a/BitPay/Models/Settlement/PayoutInfo.cs +++ b/BitPay/Models/Settlement/PayoutInfo.cs @@ -8,5 +8,24 @@ public class PayoutInfo public string MerchantEin { get; set; } public string Label { get; set; } public string BankCountry { get; set; } + public string Bank { get; set; } + public string Swift { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Postal { get; set; } + public string MerchantEIN { get; set; } + public string Sort { get; set; } + public string Wire { get; set; } + public string BankName { get; set; } + public string BankAddress { get; set; } + public string BankAddress2 { get; set; } + public string Iban { get; set; } + public string AdditionalInformation { get; set; } + public string AccountHolderName { get; set; } + public string AccountHolderAddress { get; set; } + public string AccountHolderAddress2 { get; set; } + public string AccountHolderPostalCode { get; set; } + public string AccountHolderCity { get; set; } + public string AccountHolderCountry { get; set; } } -} \ No newline at end of file +} diff --git a/BitPayUnitTest/BitPayTest.cs b/BitPayUnitTest/BitPayTest.cs index ba18dd5..a9d6d66 100644 --- a/BitPayUnitTest/BitPayTest.cs +++ b/BitPayUnitTest/BitPayTest.cs @@ -481,10 +481,10 @@ public async Task TestShouldGetAndUpdateBill() { retrievedBill.Items.Add(new Item(){Price = 60.0, Quantity = 7, Description = "product-added"}); var updatedBill = await _bitpay.UpdateBill(retrievedBill, retrievedBill.Id); - Assert.Equals(basicBill.Id, retrievedBill.Id); - Assert.Equals(retrievedBill.Id, updatedBill.Id); - Assert.Equals(updatedBill.Currency, Currency.EUR); - Assert.Equals(updatedBill.Name, "updatedBill"); + Assert.AreEqual(basicBill.Id, retrievedBill.Id); + Assert.AreEqual(retrievedBill.Id, updatedBill.Id); + Assert.AreEqual(updatedBill.Currency, Currency.EUR); + Assert.AreEqual(updatedBill.Name, "updatedBill"); } [TestMethod]