Skip to content

Commit

Permalink
Add network_token destination request. Fix challenge indicator and ex…
Browse files Browse the repository at this point in the history
…emption (#447)
  • Loading branch information
armando-rodriguez-cko authored Oct 17, 2024
1 parent 002807a commit cc36679
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 24 deletions.
10 changes: 0 additions & 10 deletions src/main/java/com/checkout/common/ChallengeIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@ public enum ChallengeIndicator {
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

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

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("trusted_listing")
TRUSTED_LISTING,
@SerializedName("trusted_listing_prompt")
TRUSTED_LISTING_PROMPT,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("3ds_outage")
THREE_DS_OUTAGE,
@SerializedName("sca_delegation")
SCA_DELEGATION,
@SerializedName("out_of_sca_scope")
OUT_OF_SCA_SCOPE,
@SerializedName("low_risk_program")
LOW_RISK_PROGRAM,
@SerializedName("recurring_operation")
RECURRING_OPERATION,
@SerializedName("sca_delegation")
SCA_DELEGATION,
@SerializedName("data_share")
DATA_SHARE,
@SerializedName("other")
OTHER,
@SerializedName(value = "None", alternate = {"NONE", "none"})
NONE,
@SerializedName("secure_corporate_payment")
SECURE_CORPORATE_PAYMENT,
@SerializedName("transaction_risk_assessment")
TRANSACTION_RISK_ASSESSMENT,
@SerializedName("trusted_listing")
TRUSTED_LISTING,

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public enum PaymentDestinationType {
ID,
@SerializedName("token")
TOKEN,
@SerializedName("network_token")
NETWORK_TOKEN,
@SerializedName("bank_account")
BANK_ACCOUNT;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.checkout.payments.request.destination;

import com.checkout.common.AccountHolder;
import com.checkout.payments.NetworkTokenType;
import com.checkout.payments.PaymentDestinationType;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public final class PaymentRequestNetworkTokenDestination extends PaymentRequestDestination {

private String token;

@SerializedName("expiry_month")
private Integer expiryMonth;

@SerializedName("expiry_year")
private Integer expiryYear;

@SerializedName("token_type")
private NetworkTokenType tokenType;

private String cryptogram;

private String eci;

@SerializedName("account_holder")
private AccountHolder accountHolder;

@Builder
private PaymentRequestNetworkTokenDestination(final String token,
final Integer expiryMonth,
final Integer expiryYear,
final NetworkTokenType tokenType,
final String cryptogram,
final String eci,
final AccountHolder accountHolder) {
super(PaymentDestinationType.NETWORK_TOKEN);
this.token = token;
this.expiryMonth = expiryMonth;
this.expiryYear = expiryYear;
this.tokenType = tokenType;
this.cryptogram = cryptogram;
this.eci = eci;
this.accountHolder = accountHolder;
}

public PaymentRequestNetworkTokenDestination() {
super(PaymentDestinationType.NETWORK_TOKEN);
}

}

0 comments on commit cc36679

Please sign in to comment.