Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDate;

/**
* Merchant account information
Expand All @@ -18,48 +18,60 @@
public final class MerchantAccount {

/**
* The unique identifier of the merchant account
* The unique identifier of the merchant account.
* [Optional]
*/
private String id;

/**
* The date when the customer's account was first registered with the merchant
* The date the customer registered their account with the merchant.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("registration_date")
private Instant registrationDate;
private LocalDate registrationDate;

/**
* The date when the customer's account was last modified
* The date the customer's account with the merchant was last modified.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("last_modified")
private Instant lastModified;
private LocalDate lastModified;

/**
* Indicates whether this is a returning customer
* Indicates whether this is a returning customer.
* [Optional]
*/
@SerializedName("returning_customer")
private Boolean returningCustomer;

/**
* The date of the customer's first transaction with the merchant
* The date of the customer's first transaction with the merchant.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("first_transaction_date")
private Instant firstTransactionDate;
private LocalDate firstTransactionDate;

/**
* The date of the customer's most recent transaction with the merchant
* The date of the customer's most recent transaction with the merchant.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("last_transaction_date")
private Instant lastTransactionDate;
private LocalDate lastTransactionDate;

/**
* The total number of orders the customer has placed with the merchant
* The total number of orders the customer has placed with the merchant.
* [Optional]
*/
@SerializedName("total_order_count")
private Integer totalOrderCount;

/**
* The amount of the customer's last payment with the merchant
* The amount of the customer's last payment with the merchant.
* [Optional]
*/
@SerializedName("last_payment_amount")
private Long lastPaymentAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDate;

/**
* Sub-merchant information for order
Expand Down Expand Up @@ -35,8 +35,10 @@ public final class OrderSubMerchant {
private Integer numberOfTrades;

/**
* The date when the sub-merchant was registered in YYYY-MM-DD format
* The date the sub-merchant was registered.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("registration_date")
private Instant registrationDate;
private LocalDate registrationDate;
}
29 changes: 27 additions & 2 deletions src/main/java/com/checkout/instruments/create/InstrumentData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,53 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDate;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public final class InstrumentData {

/**
* The SEPA account number.
* [Optional]
*/
@SerializedName("account_number")
private String accoountNumber;

/**
* The country of the SEPA account.
* [Optional]
*/
private CountryCode country;

/**
* The currency of the SEPA account.
* [Optional]
*/
private Currency currency;

/**
* The payment type for this instrument.
* [Optional]
*/
@SerializedName("payment_type")
private PaymentType paymentType;

/**
* The unique identifier of the SEPA mandate.
* [Optional]
*/
@SerializedName("mandate_id")
private String mandateId;

/**
* The date the mandate was signed.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("date_of_signature")
private Instant dateOfSignature;
private LocalDate dateOfSignature;

}
81 changes: 79 additions & 2 deletions src/main/java/com/checkout/payments/ProductRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,139 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDate;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public final class ProductRequest {

/**
* The item type.
* [Optional]
*/
private ItemType type;

/**
* The item sub-type.
* [Optional]
*/
@SerializedName("sub_type")
private ItemSubType subType;

/**
* The item name.
* [Optional]
*/
private String name;

/**
* The number of items.
* [Optional]
*/
private Long quantity;

/**
* The price of the item.
* [Optional]
*/
@SerializedName("unit_price")
private Long unitPrice;

/**
* A reference for the item.
* [Optional]
*/
private String reference;

/**
* The commodity code.
* [Optional]
*/
@SerializedName("commodity_code")
private String commodityCode;

/**
* The unit of measure.
* [Optional]
*/
@SerializedName("unit_of_measure")
private String unitOfMeasure;

/**
* The total amount of the item.
* [Optional]
*/
@SerializedName("total_amount")
private Long totalAmount;

/**
* The tax rate applied to the item.
* [Optional]
*/
@SerializedName("tax_rate")
private Long taxRate;

/**
* The amount of tax applied to the item.
* [Optional]
*/
@SerializedName("tax_amount")
private Long taxAmount;

/**
* The amount discounted from the item.
* [Optional]
*/
@SerializedName("discount_amount")
private Long discountAmount;

/**
* The WeChat Pay goods ID.
* [Optional]
*/
@SerializedName("wxpay_goods_id")
private String wxpayGoodsId;

/**
* The URL of the product image.
* [Optional]
*/
@SerializedName("image_url")
private String imageUrl;

/**
* The URL of the product page.
* [Optional]
*/
private String url;

/**
* The stock keeping unit.
* [Optional]
*/
private String sku;

/**
* Maximum date for the service to be rendered or ended.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("service_ends_on")
private Instant serviceEndsOn;
private LocalDate serviceEndsOn;

/**
* The country in which the purchase was made.
* [Optional]
*/
@SerializedName("purchase_country")
private CountryCode purchaseCountry;

/**
* The amount in a foreign retailer's local currency.
* [Optional]
*/
@SerializedName("foreign_retailer_amount")
private Long foreignRetailerAmount;

Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/checkout/payments/ProductResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDate;

@Data
@Builder
Expand Down Expand Up @@ -54,8 +54,13 @@ public final class ProductResponse {

private String sku;

/**
* Maximum date for the service to be rendered or ended.
* [Optional]
* Format: yyyy-MM-dd
*/
@SerializedName("service_ends_on")
private Instant serviceEndsOn;
private LocalDate serviceEndsOn;

public ProductType getTypeAsEnum() {
return type instanceof ProductType ? (ProductType) type : null;
Expand Down
Loading
Loading