Skip to content

Commit

Permalink
Update payment sessions schemas wip
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko committed Jul 29, 2024
1 parent 3dbf1e6 commit 6e9f64d
Show file tree
Hide file tree
Showing 45 changed files with 525 additions and 144 deletions.
18 changes: 7 additions & 11 deletions src/main/java/com/checkout/common/CardCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@

public enum CardCategory {

@SerializedName(value = "Consumer", alternate = {"CONSUMER", "consumer"})
CONSUMER,

@SerializedName(value = "Commercial", alternate = {"COMMERCIAL", "commercial"})
COMMERCIAL,

@SerializedName(value = "All", alternate = {"ALL", "all"})
ALL,

@SerializedName(value = "Other", alternate = {"OTHER", "other"})
OTHER,

@SerializedName(value = "Commercial", alternate = {"COMMERCIAL", "commercial"})
COMMERCIAL,
@SerializedName(value = "Consumer", alternate = {"CONSUMER", "consumer"})
CONSUMER,
@SerializedName(value = "NotSet", alternate = {"NOTSET", "NOT_SET", "Not_Set", "notset", "not_set"})
NOT_SET
NOT_SET,
@SerializedName(value = "Other", alternate = {"OTHER", "other"})
OTHER

}
8 changes: 4 additions & 4 deletions src/main/java/com/checkout/common/CardType.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

public enum CardType {

@SerializedName(value = "Charge", alternate = {"CHARGE", "charge"})
CHARGE,
@SerializedName(value = "Credit", alternate = {"CREDIT", "credit"})
CREDIT,
@SerializedName(value = "Debit", alternate = {"DEBIT", "debit"})
DEBIT,
@SerializedName(value = "Deferred Debit", alternate = {"DEFERRED DEBIT", "deferred_debit"})
DEFERRED_DEBIT,
@SerializedName(value = "Prepaid", alternate = {"PREPAID", "prepaid"})
PREPAID,
@SerializedName(value = "Charge", alternate = {"CHARGE", "charge"})
CHARGE,
@SerializedName(value = "Deferred Debit", alternate = {"DEFERRED DEBIT", "deferred_debit"})
DEFERRED_DEBIT

}
18 changes: 9 additions & 9 deletions src/main/java/com/checkout/common/ChallengeIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

public enum ChallengeIndicator {

@SerializedName("no_preference")
NO_PREFERENCE,
@SerializedName("no_challenge_requested")
NO_CHALLENGE_REQUESTED,
@SerializedName("challenge_requested")
CHALLENGE_REQUESTED,
@SerializedName("challenge_requested_mandate")
CHALLENGE_REQUESTED_MANDATE,
@SerializedName("data_share")
DATA_SHARE,
@SerializedName("low_value")
LOW_VALUE,
@SerializedName("no_challenge_requested")
NO_CHALLENGE_REQUESTED,
@SerializedName("no_preference")
NO_PREFERENCE,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("trusted_listing")
TRUSTED_LISTING,
@SerializedName("trusted_listing_prompt")
TRUSTED_LISTING_PROMPT,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("data_share")
DATA_SHARE
TRUSTED_LISTING_PROMPT

}
24 changes: 12 additions & 12 deletions src/main/java/com/checkout/common/Exemption.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

public enum Exemption {

@SerializedName("3ds_outage")
THREE_DS_OUTAGE,
@SerializedName("None")
NONE,
@SerializedName("low_risk_program")
LOW_RISK_PROGRAM,
@SerializedName("low_value")
LOW_VALUE,
@SerializedName("other")
OTHER,
@SerializedName("out_of_sca_scope")
OUT_OF_SCA_SCOPE,
@SerializedName("recurring_operation")
RECURRING_OPERATION,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("sca_delegation")
SCA_DELEGATION,
@SerializedName("secure_corporate_payment")
SECURE_CORPORATE_PAYMENT,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("trusted_listing")
TRUSTED_LISTING,
@SerializedName("3ds_outage")
THREE_DS_OUTAGE,
@SerializedName("sca_delegation")
SCA_DELEGATION,
@SerializedName("out_of_sca_scope")
OUT_OF_SCA_SCOPE,
@SerializedName("other")
OTHER,
@SerializedName("low_risk_program")
LOW_RISK_PROGRAM

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import com.google.gson.annotations.SerializedName;

public enum AccountTypeCardProduct {

@SerializedName("not_applicable")
NOT_APPLICABLE,

@SerializedName("credit")
CREDIT,

@SerializedName("debit")
DEBIT,
@SerializedName("not_applicable")
NOT_APPLICABLE

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
import com.google.gson.annotations.SerializedName;

public enum CardholderAccountAgeIndicator {

@SerializedName("no_account")
NO_ACCOUNT,

@SerializedName("this_transaction")
THIS_TRANSACTION,


@SerializedName("less_than_thirty_days")
LESS_THAN_THIRTY_DAYS,

@SerializedName("thirty_to_sixty_days")
THIRTY_TO_SIXTY_DAYS,

@SerializedName("more_than_sixty_days")
MORE_THAN_SIXTY_DAYS,
@SerializedName("no_account")
NO_ACCOUNT,
@SerializedName("thirty_to_sixty_days")
THIRTY_TO_SIXTY_DAYS,
@SerializedName("this_transaction")
THIS_TRANSACTION

}
14 changes: 7 additions & 7 deletions src/main/java/com/checkout/sessions/AuthenticationMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

public enum AuthenticationMethod {

@SerializedName("no_authentication")
NO_AUTHENTICATION,
@SerializedName("own_credentials")
OWN_CREDENTIALS,
@SerializedName("federated_id")
FEDERATED_ID,
@SerializedName("fido")
FIDO,
@SerializedName("issuer_credentials")
ISSUER_CREDENTIALS,
@SerializedName("no_authentication")
NO_AUTHENTICATION,
@SerializedName("own_credentials")
OWN_CREDENTIALS,
@SerializedName("third_party_authentication")
THIRD_PARTY_AUTHENTICATION,
@SerializedName("fido")
FIDO
THIRD_PARTY_AUTHENTICATION

}
15 changes: 6 additions & 9 deletions src/main/java/com/checkout/sessions/AuthenticationType.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@

public enum AuthenticationType {

@SerializedName("regular")
REGULAR,
@SerializedName("recurring")
RECURRING,

@SerializedName("add_card")
ADD_CARD,
@SerializedName("installment")
INSTALLMENT,

@SerializedName("maintain_card")
MAINTAIN_CARD,

@SerializedName("add_card")
ADD_CARD,
@SerializedName("recurring")
RECURRING,
@SerializedName("regular")
REGULAR

}
4 changes: 1 addition & 3 deletions src/main/java/com/checkout/sessions/CardInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.Map;

@Data
public final class CardInfo {

Expand All @@ -14,6 +12,6 @@ public final class CardInfo {
@SerializedName("fingerprint")
private String fingerprint;

private Map<String, String> metadata;
private SessionsCardMetadataResponse metadata;

}
46 changes: 46 additions & 0 deletions src/main/java/com/checkout/sessions/CardholderAccountInfo.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.checkout.sessions;

import com.checkout.payments.AccountChangeIndicator;
import com.checkout.payments.AccountPasswordChangeIndicator;
import com.checkout.payments.AccountTypeCardProduct;
import com.checkout.payments.CardholderAccountAgeIndicator;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;

@Data
@Builder
@AllArgsConstructor
Expand Down Expand Up @@ -33,7 +39,47 @@ public final class CardholderAccountInfo {
@SerializedName("transactions_today")
private Long transactionsToday;

/**
* @deprecated This property will be removed in the future, and should be used
*/
@Deprecated
@SerializedName("authentication_method")
private AuthenticationMethod authenticationMethod;

@SerializedName("cardholder_account_age_indicator")
private CardholderAccountAgeIndicator cardholderAccountAgeIndicator;

@SerializedName("account_change")
private Instant accountChange;

@SerializedName("account_change_indicator")
private AccountChangeIndicator accountChangeIndicator;

@SerializedName("account_date")
private Instant accountDate;

@SerializedName("account_password_change")
private String accountPasswordChange;

@SerializedName("account_password_change_indicator")
private AccountPasswordChangeIndicator accountPasswordChangeIndicator;

@SerializedName("transactions_per_year")
private Integer transactionsPerYear;

@SerializedName("payment_account_age")
private Instant paymentAccountAge;

@SerializedName("shipping_address_usage")
private Instant shippingAddressUsage;

@SerializedName("account_type")
private AccountTypeCardProduct accountType;

@SerializedName("account_id")
private String accountId;

@SerializedName("three_ds_requestor_authentication_info")
private ThreeDsRequestorAuthenticationInfo threeDsRequestorAuthenticationInfo;

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

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

@Data
public final class Certificates {

@SerializedName("ds_public")
private String dsPublic;

@SerializedName("ca_public")
private String caPublic;

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ public enum ChallengeCancelReason {

@SerializedName("cardholder_cancel")
CARDHOLDER_CANCEL,
@SerializedName("transaction_timed_out")
TRANSACTION_TIMED_OUT,
@SerializedName("challenge_timed_out")
CHALLENGE_TIMED_OUT,
@SerializedName("transaction_error")
TRANSACTION_ERROR,
@SerializedName("sdk_timed_out")
SDK_TIMED_OUT,
@SerializedName("transaction_error")
TRANSACTION_ERROR,
@SerializedName("transaction_timed_out")
TRANSACTION_TIMED_OUT,
@SerializedName("unknown")
UNKNOWN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public final class CreateSessionAcceptedResponse extends Resource {
@SerializedName("protocol_version")
private String protocolVersion;

@SerializedName("account_info")
private CardholderAccountInfo accountInfo;

@SerializedName("merchant_risk_info")
private MerchantRiskInfo merchantRiskInfo;

private String reference;

private CardInfo card;
Expand All @@ -55,10 +61,15 @@ public final class CreateSessionAcceptedResponse extends Resource {

private Installment installment;

@SerializedName("initial_transaction")
private InitialTransaction initialTransaction;

@SerializedName("authentication_date")
private Instant authenticationDate;

@SerializedName("challenge_indicator")
private ChallengeIndicator challengeIndicator;

private Optimization optimization;

}
13 changes: 12 additions & 1 deletion src/main/java/com/checkout/sessions/GetSessionResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public class GetSessionResponse extends Resource {
@SerializedName("protocol_version")
private String protocolVersion;

@SerializedName("account_info")
private CardholderAccountInfo cardholderAccountInfo;

@SerializedName("merchant_risk_info")
private MerchantRiskInfo merchantRiskInfo;

private String reference;

@SerializedName("transaction_type")
Expand Down Expand Up @@ -88,6 +94,9 @@ public class GetSessionResponse extends Resource {

private Installment installment;

@SerializedName("initial_transaction")
private InitialTransaction initialTransaction;

@SerializedName("customer_ip")
private String customerIp;

Expand All @@ -100,7 +109,9 @@ public class GetSessionResponse extends Resource {
private ThreeDSFlowType flowType;

@SerializedName("challenge_indicator")
private ChallengeIndicator challengeIndicator;
private ChallengeIndicator challengeIndicator = ChallengeIndicator.NO_PREFERENCE;

private Optimization optimization;

@SerializedName("scheme_info")
private SchemeInfo schemeInfo;
Expand Down
Loading

0 comments on commit 6e9f64d

Please sign in to comment.