Skip to content

Commit

Permalink
#v4.1.2110.0-rc - Added missing properties in models (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppatidar2021 authored Oct 26, 2021
1 parent a626780 commit f59e237
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 7 deletions.
55 changes: 54 additions & 1 deletion BitPay/Models/Invoice/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -116,6 +125,10 @@ public string Currency

public int TargetConfirmations { get; set; }

public int UnderpaidAmount { get; set; }

public int OverpaidAmount { get; set; }

public List<InvoiceTransaction> Transactions { get; set; }

public string ExceptionStatus { get; set; }
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -187,6 +204,11 @@ public bool ShouldSerializeFullNotifications()
return FullNotifications;
}

public bool ShouldSerializeAutoRedirect()
{
return AutoRedirect;
}

public bool ShouldSerializeExtendedNotifications()
{
return ExtendedNotifications;
Expand Down Expand Up @@ -267,6 +289,7 @@ public bool ShouldSerializeAmountPaid()
return false;
}


public bool ShouldSerializePaymentTotals()
{
return false;
Expand Down Expand Up @@ -332,6 +355,16 @@ public bool ShouldSerializeTargetConfirmations()
return false;
}

public bool ShouldSerializeUnderpaidAmount()
{
return false;
}

public bool ShouldSerializeOverpaidAmount()
{
return false;
}

public bool ShouldSerializeTransactions()
{
return false;
Expand All @@ -347,6 +380,16 @@ public bool ShouldSerializeRefundAddresses()
return false;
}

public bool ShouldSerializeNonPayProPaymentReceived()
{
return false;
}

public bool ShouldSerializeJsonPayProRequired()
{
return false;
}

public bool ShouldSerializeRefundAddressRequestPending()
{
return false;
Expand All @@ -361,5 +404,15 @@ public bool ShouldSerializeBuyerProvidedInfo()
{
return false;
}

public bool ShouldSerializeDisplayAmountPaid()
{
return !string.IsNullOrEmpty(DisplayAmountPaid);
}

public bool ShouldSerializeCloseURL()
{
return !string.IsNullOrEmpty(CloseURL);
}
}
}
}
2 changes: 2 additions & 0 deletions BitPay/Models/Invoice/InvoiceBuyerProvidedInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class InvoiceBuyerProvidedInfo

public string EmailAddress { get; set; }

public string SelectedWallet { get; set; }

public string SetSelectedTransactionCurrency { get; set; }
}
}
5 changes: 4 additions & 1 deletion BitPay/Models/Payout/PayoutInstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -126,4 +129,4 @@ public bool ShouldSerializeWalletProvider()
return !string.IsNullOrEmpty(WalletProvider);
}
}
}
}
21 changes: 20 additions & 1 deletion BitPay/Models/Settlement/PayoutInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
}
8 changes: 4 additions & 4 deletions BitPayUnitTest/BitPayTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f59e237

Please sign in to comment.