Skip to content

Commit

Permalink
Merge pull request #268 from mwarzybok-sumoheavy/feature/SP-737
Browse files Browse the repository at this point in the history
SP-737 Type Review: Java
  • Loading branch information
bobbrodie authored Jan 26, 2024
2 parents 8a2cca2 + 515daf7 commit de56bd0
Show file tree
Hide file tree
Showing 48 changed files with 713 additions and 371 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/bitpay/sdk/model/Facade.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum Facade {
*/
POS("pos");

private final String value;
protected final String value;

Facade(String value) {
this.value = value;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/bitpay/sdk/model/Policy.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Policy {

private String policy;
private String method;
private List<String> params;
protected String policy;
protected String method;
protected List<String> params;

/**
* Instantiates a new Policy.
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/bitpay/sdk/model/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Token {

private String guid;
private String id;
private String pairingCode;
private Long pairingExpiration;
private String facade;
private String label;
private Integer count = 0;
private List<Policy> policies;
private String resource;
private String value;
private Long dateCreated;
protected String guid;
protected String id;
protected String pairingCode;
protected Long pairingExpiration;
protected String facade;
protected String label;
protected Integer count = 0;
protected List<Policy> policies;
protected String resource;
protected String value;
protected Long dateCreated;

/**
* Instantiates a new Token.
Expand Down
42 changes: 21 additions & 21 deletions src/main/java/com/bitpay/sdk/model/bill/Bill.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Bill {

private String currency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String token = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String email = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private List<Item> items;
private String number = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String address1 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String address2 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String city = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String state = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String zip = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String country = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private List<String> cc;
private String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private ZonedDateTime dueDate;
private Boolean passProcessingFee;
private String status = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String url = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private ZonedDateTime createdDate;
private String id = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String merchant = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String currency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String token = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String email = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected List<Item> items;
protected String number = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String address1 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String address2 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String city = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String state = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String zip = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String country = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected List<String> cc;
protected String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected ZonedDateTime dueDate;
protected Boolean passProcessingFee;
protected String status = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String url = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected ZonedDateTime createdDate;
protected String id = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String merchant = ModelConfiguration.DEFAULT_NON_SENT_VALUE;

/**
* Constructor, create an empty Bill object.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/bitpay/sdk/model/bill/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Item {

private String id;
private String description = DEFAULT_NON_SENT_VALUE;
private Double price;
private Integer quantity;
protected String id;
protected String description = DEFAULT_NON_SENT_VALUE;
protected Double price;
protected Integer quantity;

/**
* Instantiates a new Item.
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/bitpay/sdk/model/invoice/Buyer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Buyer {

private String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String address1 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String address2 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String locality = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String region = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String postalCode = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String country = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String email = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean notify;
protected String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String address1 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String address2 = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String locality = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String region = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String postalCode = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String country = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String email = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String phone = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean notify;

/**
* Instantiates a new Buyer.
Expand Down
133 changes: 67 additions & 66 deletions src/main/java/com/bitpay/sdk/model/invoice/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

/**
* The type Invoice.
Expand All @@ -27,70 +28,70 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Invoice {

private String currency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;

private String guid;
private String token;

private Double price;
private String posData;
private String notificationUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String transactionSpeed = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean fullNotifications;
private String notificationEmail = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String redirectUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String closeUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String orderId = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String itemDesc = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String itemCode = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean physical;
private List<String> paymentCurrencies;
private Integer acceptanceWindow;
private Buyer buyer;
private String buyerSms = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String merchantName = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String selectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String forcedBuyerSelectedWallet = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private InvoiceUniversalCodes universalCodes;
private List<InvoiceItemizedDetails> itemizedDetails;
private Boolean autoRedirect;

private String id;
private String url = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String status = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean lowFeeDetected;
private Long invoiceTime;
private Long expirationTime;
private Long currentTime;
private String exceptionStatus = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Integer targetConfirmations;
private List<InvoiceTransaction> transactions;
private ArrayList refundAddresses;
private Boolean refundAddressRequestPending;
private String buyerProvidedEmail = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private InvoiceBuyerProvidedInfo invoiceBuyerProvidedInfo;
private SupportedTransactionCurrencies supportedTransactionCurrencies;
private MinerFees minerFees;
private Shopper shopper;
private String billId = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private ArrayList<RefundInfo> refundInfo;
private Boolean extendedNotifications;
private String transactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String forcedBuyerSelectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private BigDecimal amountPaid;
private String displayAmountPaid;
private Hashtable<String, Hashtable<String, BigDecimal>> exchangeRates;
private Boolean isCancelled;
private Boolean bitpayIdRequired;
private Hashtable<String, BigInteger> paymentSubtotals;
private Hashtable<String, BigInteger> paymentTotals;
private Hashtable<String, String> paymentDisplayTotals;
private Hashtable<String, String> paymentDisplaySubTotals;
private Boolean nonPayProPaymentReceived;
private Boolean jsonPayProRequired;
private BigDecimal underpaidAmount;
private BigDecimal overpaidAmount;
private Hashtable<String, Hashtable<String, String>> paymentCodes;
protected String currency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;

protected String guid;
protected String token;

protected Double price;
protected String posData;
protected String notificationUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String transactionSpeed = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean fullNotifications;
protected String notificationEmail = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String redirectUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String closeUrl = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String orderId = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String itemDesc = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String itemCode = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean physical;
protected List<String> paymentCurrencies;
protected Integer acceptanceWindow;
protected Buyer buyer;
protected String buyerSms = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String merchantName = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String selectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String forcedBuyerSelectedWallet = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected InvoiceUniversalCodes universalCodes;
protected List<InvoiceItemizedDetails> itemizedDetails;
protected Boolean autoRedirect;

protected String id;
protected String url = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String status = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean lowFeeDetected;
protected Long invoiceTime;
protected Long expirationTime;
protected Long currentTime;
protected String exceptionStatus = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Integer targetConfirmations;
protected List<InvoiceTransaction> transactions;
protected List<Map<String, InvoiceRefundAddresses>> refundAddresses;
protected Boolean refundAddressRequestPending;
protected String buyerProvidedEmail = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected InvoiceBuyerProvidedInfo invoiceBuyerProvidedInfo;
protected SupportedTransactionCurrencies supportedTransactionCurrencies;
protected MinerFees minerFees;
protected Shopper shopper;
protected String billId = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected ArrayList<RefundInfo> refundInfo;
protected Boolean extendedNotifications;
protected String transactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String forcedBuyerSelectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected BigDecimal amountPaid;
protected String displayAmountPaid;
protected Hashtable<String, Hashtable<String, BigDecimal>> exchangeRates;
protected Boolean isCancelled;
protected Boolean bitpayIdRequired;
protected Hashtable<String, BigInteger> paymentSubtotals;
protected Hashtable<String, BigInteger> paymentTotals;
protected Hashtable<String, String> paymentDisplayTotals;
protected Hashtable<String, String> paymentDisplaySubTotals;
protected Boolean nonPayProPaymentReceived;
protected Boolean jsonPayProRequired;
protected BigDecimal underpaidAmount;
protected BigDecimal overpaidAmount;
protected Hashtable<String, Hashtable<String, String>> paymentCodes;

/**
* Constructor, create an empty Invoice object.
Expand Down Expand Up @@ -1168,7 +1169,7 @@ public void setTargetConfirmations(final Integer targetConfirmations) {
* @return the refund addresses
*/
@JsonIgnore
public ArrayList getRefundAddresses() {
public List<Map<String, InvoiceRefundAddresses>> getRefundAddresses() {
return this.refundAddresses;
}

Expand All @@ -1179,7 +1180,7 @@ public ArrayList getRefundAddresses() {
* @param refundAddresses the refund addresses
*/
@JsonProperty("refundAddresses")
public void setRefundAddresses(final ArrayList refundAddresses) {
public void setRefundAddresses(final List<Map<String, InvoiceRefundAddresses>> refundAddresses) {
this.refundAddresses = refundAddresses;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class InvoiceBuyerProvidedInfo {

private String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String phoneNumber = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String selectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String emailAddress = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String selectedWallet = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private String sms = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean smsVerified;
protected String name = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String phoneNumber = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String selectedTransactionCurrency = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String emailAddress = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String selectedWallet = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected String sms = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean smsVerified;

/**
* Instantiates a new Invoice buyer provided info.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
public class InvoiceEventToken {

private String token = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private List<String> events;
private List<String> actions;
protected String token = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected List<String> events;
protected List<String> actions;

/**
* Instantiates a new Invoice event token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class InvoiceItemizedDetails {
private Double amount;
private String description = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
private Boolean isFee;
protected Double amount;
protected String description = ModelConfiguration.DEFAULT_NON_SENT_VALUE;
protected Boolean isFee;

/**
* Instantiates a new Invoice itemized details.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2019 BitPay.
* All rights reserved.
*/

package com.bitpay.sdk.model.invoice;

import java.time.ZonedDateTime;

public class InvoiceRefundAddresses {

protected String type;
protected ZonedDateTime date;
protected Integer tag;
protected String email;

public String getType() {
return this.type;
}

public void setType(String type) {
this.type = type;
}

public ZonedDateTime getDate() {
return this.date;
}

public void setDate(ZonedDateTime date) {
this.date = date;
}

public Integer getTag() {
return this.tag;
}

public void setTag(Integer tag) {
this.tag = tag;
}

public String getEmail() {
return this.email;
}

public void setEmail(String email) {
this.email = email;
}
}
Loading

0 comments on commit de56bd0

Please sign in to comment.