Skip to content

Commit 6989d0d

Browse files
authored
#v6.4.2110.0-rc - Add missing properties in models (#77)
- Invoice - PayoutInstruction - PayoutInfo
1 parent c3a549f commit 6989d0d

File tree

4 files changed

+157
-5
lines changed

4 files changed

+157
-5
lines changed

src/main/java/com/bitpay/sdk/model/Invoice/Invoice.java

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class Invoice {
2727
private boolean _fullNotifications = false;
2828
private String _notificationEmail = "";
2929
private String _redirectURL = "";
30+
private String _closeURL = "";
3031
private String _orderId = "";
3132
private String _itemDesc = "";
3233
private String _itemCode = "";
@@ -41,6 +42,7 @@ public class Invoice {
4142
private InvoiceTransactionDetails _transactionDetails;
4243
private InvoiceUniversalCodes _universalCodes;
4344
private List<InvoiceItemizedDetails> _itemizedDetails;
45+
private boolean _autoRedirect = false;
4446

4547
private String _id;
4648
private String _url;
@@ -64,10 +66,20 @@ public class Invoice {
6466
private boolean _extendedNotifications = false;
6567
private String _transactionCurrency;
6668
private BigDecimal _amountPaid;
69+
private BigDecimal _displayAmountPaid;
6770
private Hashtable<String, Hashtable<String, String>> _exchangeRates;
6871
private boolean _isCancelled = false;
6972
private boolean _bitpayIdRequired = false;
70-
73+
private Hashtable<String, String> _paymentSubtotals;
74+
private Hashtable<String, String> _paymentTotals;
75+
private Hashtable<String, String> _paymentDisplayTotals;
76+
private Hashtable<String, String> _paymentDisplaySubTotals;
77+
private boolean _nonPayProPaymentReceived;
78+
private boolean _jsonPayProRequired = false;
79+
private BigDecimal _underpaidAmount;
80+
private BigDecimal _overpaidAmount;
81+
private Hashtable<String, Hashtable<String, String>> _paymentCodes;
82+
7183
/**
7284
* Constructor, create an empty Invoice object.
7385
*/
@@ -249,6 +261,17 @@ public void setRedirectURL(String _redirectURL) {
249261
this._redirectURL = _redirectURL;
250262
}
251263

264+
@JsonProperty("closeURL")
265+
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
266+
public String getCloseURL() {
267+
return _closeURL;
268+
}
269+
270+
@JsonProperty("closeURL")
271+
public void setCloseURL(String _closeURL) {
272+
this._closeURL = _closeURL;
273+
}
274+
252275
@JsonProperty("physical")
253276
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
254277
public boolean getPhysical() {
@@ -351,6 +374,16 @@ public void setItemizedDetails(List<InvoiceItemizedDetails> _itemizedDetails) {
351374
this._itemizedDetails = _itemizedDetails;
352375
}
353376

377+
@JsonIgnore
378+
public boolean getAutoRedirect() {
379+
return _autoRedirect;
380+
}
381+
382+
@JsonProperty("autoRedirect")
383+
public void setAutoRedirect(boolean _autoRedirect) {
384+
this._autoRedirect = _autoRedirect;
385+
}
386+
354387
@JsonProperty("bitpayIdRequired")
355388
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
356389
public boolean getBitpayIdRequired() {
@@ -600,6 +633,16 @@ public void setAmountPaid(BigDecimal _amountPaid) {
600633
this._amountPaid = _amountPaid;
601634
}
602635

636+
@JsonIgnore
637+
public BigDecimal getDisplayAmountPaid() {
638+
return _displayAmountPaid;
639+
}
640+
641+
@JsonProperty("displayAmountPaid")
642+
public void setDisplayAmountPaid(BigDecimal _displayAmountPaid) {
643+
this._displayAmountPaid = _displayAmountPaid;
644+
}
645+
603646
@JsonIgnore
604647
public Hashtable<String, Hashtable<String, String>> getExchangeRates() {
605648
return _exchangeRates;
@@ -619,4 +662,94 @@ public boolean getIsCancelled() {
619662
public void setIsCancelled(boolean _isCancelled) {
620663
this._isCancelled = _isCancelled;
621664
}
622-
}
665+
666+
@JsonIgnore
667+
public Hashtable<String, String> getPaymentSubTotals() {
668+
return _paymentSubtotals;
669+
}
670+
671+
@JsonProperty("paymentSubtotals")
672+
public void setPaymentSubTotals(Hashtable<String, String> _paymentSubtotals) {
673+
this._paymentSubtotals = _paymentSubtotals;
674+
}
675+
676+
@JsonIgnore
677+
public Hashtable<String, String> getPaymentTotals() {
678+
return _paymentTotals;
679+
}
680+
681+
@JsonProperty("paymentTotals")
682+
public void setPaymentTotals(Hashtable<String, String> _paymentTotals) {
683+
this._paymentTotals = _paymentTotals;
684+
}
685+
686+
@JsonIgnore
687+
public Hashtable<String, String> getPaymentDisplayTotals() {
688+
return _paymentDisplayTotals;
689+
}
690+
691+
@JsonProperty("paymentDisplayTotals")
692+
public void setPaymentDisplayTotals(Hashtable<String, String> _paymentDisplayTotals) {
693+
this._paymentDisplayTotals = _paymentDisplayTotals;
694+
}
695+
696+
@JsonIgnore
697+
public Hashtable<String, String> getPaymentDisplaySubTotals() {
698+
return _paymentDisplaySubTotals;
699+
}
700+
701+
@JsonProperty("paymentDisplaySubTotals")
702+
public void setPaymentDisplaySubTotals(Hashtable<String, String> _paymentDisplaySubTotals) {
703+
this._paymentDisplaySubTotals = _paymentDisplaySubTotals;
704+
}
705+
706+
@JsonIgnore
707+
public boolean getNonPayProPaymentReceived() {
708+
return _nonPayProPaymentReceived;
709+
}
710+
711+
@JsonProperty("nonPayProPaymentReceived")
712+
public void setNonPayProPaymentReceived(boolean _nonPayProPaymentReceived) {
713+
this._nonPayProPaymentReceived = _nonPayProPaymentReceived;
714+
}
715+
716+
@JsonIgnore
717+
public boolean getJsonPayProRequired() {
718+
return _jsonPayProRequired;
719+
}
720+
721+
@JsonProperty("jsonPayProRequired")
722+
public void setJsonPayProRequired(boolean _jsonPayProRequired) {
723+
this._jsonPayProRequired = _jsonPayProRequired;
724+
}
725+
726+
@JsonIgnore
727+
public BigDecimal getUnderPaidAmount() {
728+
return _underpaidAmount;
729+
}
730+
731+
@JsonProperty("underpaidAmount")
732+
public void setUnderPaidAmount(BigDecimal _underpaidAmount) {
733+
this._underpaidAmount = _underpaidAmount;
734+
}
735+
736+
@JsonIgnore
737+
public BigDecimal getOverPaidAmount() {
738+
return _overpaidAmount;
739+
}
740+
741+
@JsonProperty("overpaidAmount")
742+
public void setOverPaidAmount(BigDecimal _overpaidAmount) {
743+
this._overpaidAmount = _overpaidAmount;
744+
}
745+
746+
@JsonIgnore
747+
public Hashtable<String, Hashtable<String, String>> getPaymentCodes() {
748+
return _paymentCodes;
749+
}
750+
751+
@JsonProperty("paymentCodes")
752+
public void setPaymentCodes(Hashtable<String, Hashtable<String, String>> _paymentCodes) {
753+
this._paymentCodes = _paymentCodes;
754+
}
755+
}

src/main/java/com/bitpay/sdk/model/Payout/PayoutInstruction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class PayoutInstruction {
2323
private PayoutInstructionBtcSummary _btc;
2424
private List<PayoutInstructionTransaction> _transactions;
2525
private String _status;
26+
private String _address;
2627

2728
/**
2829
* Constructor, create an empty PayoutInstruction object.
@@ -164,4 +165,15 @@ public String getStatus() {
164165
public void setStatus(String status) {
165166
this._status = status;
166167
}
168+
169+
@JsonProperty("address")
170+
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
171+
public String getAddress() {
172+
return _address;
173+
}
174+
175+
@JsonProperty("address")
176+
public void setAddress(String address) {
177+
this._address = address;
178+
}
167179
}

src/main/java/com/bitpay/sdk/model/Settlement/PayoutInfo.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class PayoutInfo {
2121
private String _wire;
2222
private String _bankName;
2323
private String _bankAddress;
24+
private String _bankAddress2;
2425
private String _iban;
2526
private String _additionalInformation;
2627
private String _accountHolderName;
@@ -147,6 +148,12 @@ public void setBankCountry(String bankCountry) {
147148
@JsonProperty("bankAddress")
148149
public void setBankAddress(String bankAddress) { this._bankAddress = bankAddress; }
149150

151+
@JsonIgnore
152+
public String getBankAddress2() { return _bankAddress2; }
153+
154+
@JsonProperty("bankAddress2")
155+
public void getBankAddress2(String bankAddress2) { this._bankAddress2 = bankAddress2; }
156+
150157
@JsonIgnore
151158
public String getIban() { return _iban; }
152159

src/test/java/test/BitPayTestMerchant.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public void testShouldGetInvoice() {
228228
//
229229
// Must use a merchant token to retrieve this invoice since it was not created on the public facade.
230230
String token = this.bitpay.getAccessToken(Facade.Merchant);
231-
retreivedInvoice = this.bitpay.getInvoice("FUfs9crxMuuJLUL1f4hxHf");
231+
retreivedInvoice = this.bitpay.getInvoice(invoice.getId());
232232
} catch (Exception e) {
233233
e.printStackTrace();
234234
fail(e.getMessage());
@@ -240,7 +240,7 @@ public void testShouldGetInvoice() {
240240
public void testShouldCreateInvoiceWithAdditionalParams() {
241241
Buyer buyer = new Buyer();
242242
buyer.setName("Satoshi");
243-
// buyer.setEmail("[email protected]");
243+
buyer.setEmail("[email protected]");
244244

245245
Invoice invoice = new Invoice(100.0, "USD");
246246
invoice.setBuyer(buyer);
@@ -743,7 +743,7 @@ public void testShouldCreateGetCancelRefundRequestNEW() {
743743
String sevenDaysAgo = sdf.format(dateBefore);
744744
invoices = this.bitpay.getInvoices(sevenDaysAgo, today, InvoiceStatus.Complete, null, null, null);
745745
firstInvoice = invoices.get(0);
746-
updatedInvoice = this.bitpay.updateInvoice(firstInvoice.getId(), "+***********", null);
746+
updatedInvoice = this.bitpay.updateInvoice(firstInvoice.getId(), "+***********", null, null);
747747
} catch (Exception e) {
748748
e.printStackTrace();
749749
}

0 commit comments

Comments
 (0)