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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion src/main/java/com/checkout/GsonSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,9 @@ private static JsonDeserializer<ProductResponse> getProductDeserializer() {
java.lang.reflect.Field field = Arrays.stream(ProductResponse.class.getDeclaredFields())
.filter(f -> {
SerializedName annotation = f.getAnnotation(SerializedName.class);
return (annotation != null && annotation.value().equals(jsonKey)) || f.getName().equals(jsonKey);
return (annotation != null && annotation.value().equals(jsonKey))
|| f.getName().equals(jsonKey)
|| FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES.translateName(f).equals(jsonKey);
})
.findFirst()
.orElse(null);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/checkout/RequestMetrics.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package com.checkout;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public final class RequestMetrics {

@SerializedName("prev_request_id")
private String prevRequestId;

@SerializedName("request_id")
private String requestId;

@SerializedName("prev_request_duration")
private Long prevRequestDuration;

public String toTelemetryHeader() {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/checkout/accounts/AccountPhone.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.checkout.accounts;

import com.checkout.common.CountryCode;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -13,7 +12,6 @@
@AllArgsConstructor
public final class AccountPhone {

@SerializedName("country_code")
private CountryCode countryCode;

private String number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
import com.checkout.common.AccountHolderType;
import com.checkout.common.Address;
import com.checkout.common.CountryCode;
import com.google.gson.annotations.SerializedName;
import lombok.Data;

@Data
public abstract class AccountsAccountHolder {

private AccountHolderType type;

@SerializedName("tax_id")
private String taxId;

@SerializedName("date_of_birth")
private DateOfBirth dateOfBirth;

@SerializedName("country_of_birth")
private CountryCode countryOfBirth;

@SerializedName("residential_status")
private String residentialStatus;

@SerializedName("billing_address")
private Address billingAddress;

private AccountPhone phone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.checkout.common.AccountHolderType;
import com.checkout.common.Address;
import com.checkout.common.CountryCode;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand All @@ -17,7 +16,6 @@
@ToString(callSuper = true)
public final class AccountsCorporateAccountHolder extends AccountsAccountHolder {

@SerializedName("company_name")
private String companyName;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.checkout.common.AccountHolderType;
import com.checkout.common.Address;
import com.checkout.common.CountryCode;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand All @@ -17,10 +16,8 @@
@EqualsAndHashCode(callSuper = true)
public final class AccountsIndividualAccountHolder extends AccountsAccountHolder {

@SerializedName("first_name")
private String firstName;

@SerializedName("last_name")
private String lastName;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.checkout.common.CountryCode;
import com.checkout.common.Currency;
import com.checkout.common.InstrumentType;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;

Expand All @@ -17,23 +16,18 @@ public final class AccountsPaymentInstrument {

private String label;

@SerializedName("account_type")
private AccountType accountType;

@SerializedName("account_number")
private String accountNumber;

@SerializedName("bank_code")
private String bankCode;

@SerializedName("branch_code")
private String branchCode;

private String iban;

private String bban;

@SerializedName("swift_bic")
private String swiftBic;

private Currency currency;
Expand All @@ -42,7 +36,6 @@ public final class AccountsPaymentInstrument {

private InstrumentDocument document;

@SerializedName("account_holder")
private AccountsAccountHolder accountHolder;

private BankDetails bank;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/checkout/accounts/Company.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.checkout.accounts;

import com.checkout.common.Address;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -15,35 +14,26 @@
@AllArgsConstructor
public final class Company {

@SerializedName("legal_name")
private String legalName;

@SerializedName("trading_name")
private String tradingName;

@SerializedName("business_registration_number")
private String businessRegistrationNumber;

@SerializedName("date_of_incorporation")
private DateOfIncorporation dateOfIncorporation;

@SerializedName("regulatory_licence_number")
private String regulatoryLicenceNumber;

@SerializedName("principal_address")
private Address principalAddress;

@SerializedName("registered_address")
private Address registeredAddress;

private List<Representative> representatives;

private EntityDocument document;

@SerializedName("financial_details")
private EntityFinancialDetails financialDetails;

@SerializedName("business_type")
private BusinessType businessType;

}
2 changes: 0 additions & 2 deletions src/main/java/com/checkout/accounts/ContactDetails.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.checkout.accounts;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -14,7 +13,6 @@ public final class ContactDetails {

private AccountPhone phone;

@SerializedName("email_addresses")
private EntityEmailAddresses emailAddresses;

private Invitee invitee;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/checkout/accounts/EntityDocument.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.checkout.accounts;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -14,7 +13,6 @@ public final class EntityDocument {

private String type;

@SerializedName("file_id")
private String fileId;

}
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package com.checkout.accounts;

import com.checkout.common.Currency;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public final class EntityFinancialDetails {

@SerializedName("annual_processing_volume")
private Long annualProcessingVolume;

@SerializedName("average_transaction_value")
private Long averageTransactionValue;

@SerializedName("highest_transaction_value")
private Long highestTransactionValue;

private EntityFinancialDocuments documents;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package com.checkout.accounts;

import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public final class EntityFinancialDocuments {

@SerializedName("bank_statement")
private EntityDocument bankStatement;

@SerializedName("financial_statement")
private EntityDocument financialStatement;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.checkout.accounts;

import com.checkout.common.Resource;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -39,7 +38,6 @@ public class EntityRequirementListItem extends Resource {
* Defaults to {@code entity} if the URN cannot be parsed.
* [Optional]
*/
@SerializedName("resource_type")
private String resourceType;

/**
Expand Down Expand Up @@ -77,15 +75,13 @@ public class EntityRequirementListItem extends Resource {
* responses) that do not map to a specific field on the entity.
* [Optional]
*/
@SerializedName("field_path")
private String fieldPath;

/**
* The schema-registry URN of the field, from the public mapping definition.
* May be {@code null} if no mapping exists.
* [Optional]
*/
@SerializedName("field_urn")
private String fieldUrn;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.checkout.accounts;

import com.checkout.common.Resource;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -38,6 +37,5 @@ public final class EntityRequirementUpdateResponse extends Resource {
* [Optional]
* Format: date-time (RFC 3339)
*/
@SerializedName("submitted_at")
private Instant submittedAt;
}
2 changes: 0 additions & 2 deletions src/main/java/com/checkout/accounts/Identification.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.checkout.accounts;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -12,7 +11,6 @@
@AllArgsConstructor
public final class Identification {

@SerializedName("national_id_number")
private String nationalIdNumber;

private Document document;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/checkout/accounts/Individual.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
package com.checkout.accounts;

import com.checkout.common.Address;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public final class Individual {

@SerializedName("first_name")
private String firstName;

@SerializedName("middle_name")
private String middleName;

@SerializedName("last_name")
private String lastName;

@SerializedName("trading_name")
private String tradingName;

@SerializedName("national_tax_id")
private String nationalTaxId;

@SerializedName("registered_address")
private Address registeredAddress;

@SerializedName("date_of_birth")
private DateOfBirth dateOfBirth;

@SerializedName("place_of_birth")
private PlaceOfBirth placeOfBirth;

private Identification identification;

@SerializedName("financial_details")
private EntityFinancialDetails financialDetails;

}
15 changes: 15 additions & 0 deletions src/main/java/com/checkout/accounts/InstrumentAccountType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.checkout.accounts;

import com.google.gson.annotations.SerializedName;

/**
* The type of bank account.
*/
public enum InstrumentAccountType {

@SerializedName("savings")
SAVINGS,

@SerializedName("checking")
CHECKING
}
Loading
Loading