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
5 changes: 3 additions & 2 deletions src/main/java/com/checkout/issuing/IssuingClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.checkout.issuing.cards.requests.update.UpdateCardRequest;
import com.checkout.issuing.cards.responses.CardDetailsResponse;
import com.checkout.issuing.cards.responses.CardResponse;
import com.checkout.issuing.cards.responses.activate.ActivateCardResponse;
import com.checkout.issuing.cards.responses.GetDigitalCardResponse;
import com.checkout.issuing.cards.responses.credentials.CardCredentialsResponse;
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentDetailsResponse;
Expand Down Expand Up @@ -87,7 +88,7 @@ public interface IssuingClient {

CompletableFuture<ThreeDSEnrollmentDetailsResponse> getCardThreeDSDetails(String cardId);

CompletableFuture<VoidResponse> activateCard(String cardId);
CompletableFuture<ActivateCardResponse> activateCard(String cardId);

CompletableFuture<CardCredentialsResponse> getCardCredentials(final String cardId, final CardCredentialsQuery queryFilter);

Expand Down Expand Up @@ -229,7 +230,7 @@ CompletableFuture<CardAuthorizationReversalResponse> simulateReversal(

ThreeDSEnrollmentDetailsResponse getCardThreeDSDetailsSync(String cardId);

VoidResponse activateCardSync(String cardId);
ActivateCardResponse activateCardSync(String cardId);

CardCredentialsResponse getCardCredentialsSync(String cardId, CardCredentialsQuery queryFilter);

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/checkout/issuing/IssuingClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.checkout.issuing.cards.requests.update.UpdateCardRequest;
import com.checkout.issuing.cards.responses.CardDetailsResponse;
import com.checkout.issuing.cards.responses.CardResponse;
import com.checkout.issuing.cards.responses.activate.ActivateCardResponse;
import com.checkout.issuing.cards.responses.credentials.CardCredentialsResponse;
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentDetailsResponse;
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentResponse;
Expand Down Expand Up @@ -254,12 +255,12 @@ public CompletableFuture<ThreeDSEnrollmentDetailsResponse> getCardThreeDSDetails
}

@Override
public CompletableFuture<VoidResponse> activateCard(final String cardId) {
public CompletableFuture<ActivateCardResponse> activateCard(final String cardId) {
validateParams("cardId", cardId);
return apiClient.postAsync(
buildPath(ISSUING_PATH, CARDS_PATH, cardId, ACTIVATE_PATH),
sdkAuthorization(),
VoidResponse.class,
ActivateCardResponse.class,
null,
null
);
Expand Down Expand Up @@ -845,12 +846,12 @@ public ThreeDSEnrollmentDetailsResponse getCardThreeDSDetailsSync(final String c
}

@Override
public VoidResponse activateCardSync(final String cardId) {
public ActivateCardResponse activateCardSync(final String cardId) {
validateCardId(cardId);
return apiClient.post(
buildPath(ISSUING_PATH, CARDS_PATH, cardId, ACTIVATE_PATH),
sdkAuthorization(),
VoidResponse.class,
ActivateCardResponse.class,
null,
null
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,23 @@ public abstract class CardRequest {
* <p>
* [Optional]
* </p>
* Format: date (YYYY-MM-DD, time is midnight UTC)
* Example: 2027-03-12
* Format: yyyy-MM-dd
*
* @deprecated Use {@link #scheduledRevocationDate} instead. If both fields are provided,
* {@code scheduledRevocationDate} overrides this value.
*/
@Deprecated
private LocalDate revocationDate;

/**
* The card will be revoked at midnight UTC on the date specified.
* <p>
* [Optional]
* </p>
* Format: yyyy-MM-dd
*/
private LocalDate scheduledRevocationDate;

/**
* Date scheduling the card's first activation. Only applies to the initial activation of a
* card. Two formats are supported: date only (YYYY-MM-DD, treated as midnight UTC), or date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ private PhysicalCardRequest(final String cardholderId,
final ShippingInstruction shippingInstructions,
final IssuingCardMetadata metadata,
final LocalDate revocationDate,
final LocalDate scheduledRevocationDate,
final String scheduledActivationDate) {
super(CardType.PHYSICAL, cardholderId, lifetime, reference, cardProductId, displayName, activateCard);
this.shippingInstructions = shippingInstructions;
setMetadata(metadata);
setRevocationDate(revocationDate);
setScheduledRevocationDate(scheduledRevocationDate);
setScheduledActivationDate(scheduledActivationDate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private VirtualCardRequest(final String cardholderId,
final Boolean isSingleUse,
final IssuingCardMetadata metadata,
final LocalDate revocationDate,
final LocalDate scheduledRevocationDate,
final String scheduledActivationDate,
final List<ReturnCredentialsType> returnCredentials,
final List<String> controlProfiles,
Expand All @@ -64,6 +65,7 @@ private VirtualCardRequest(final String cardholderId,
this.controls = controls;
setMetadata(metadata);
setRevocationDate(revocationDate);
setScheduledRevocationDate(scheduledRevocationDate);
setScheduledActivationDate(scheduledActivationDate);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.checkout.issuing.cards.requests.update;

import com.checkout.issuing.cards.CardStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -13,6 +14,17 @@
@AllArgsConstructor
public final class UpdateCardRequest {

/**
* Set the card's status to {@code ACTIVE} to reactivate an {@code INACTIVE} or
* {@code SUSPENDED} card. The API only accepts {@code active} for this field.
* <p>
* [Optional]
* </p>
* Mutually exclusive with {@link #scheduledActivationDate}: submitting both results in the
* API error {@code scheduled_activation_date_conflicts_with_activation}.
*/
private CardStatus status;

/**
* Your reference.
* [Optional]
Expand Down Expand Up @@ -58,8 +70,20 @@ public final class UpdateCardRequest {
* <p>
* [Optional]
* </p>
* Format: date (YYYY-MM-DD, time is midnight UTC)
* Example: 2027-03-12
* Format: yyyy-MM-dd
*
* @deprecated Use {@link #scheduledRevocationDate} instead. If both fields are provided,
* {@code scheduledRevocationDate} overrides this value.
*/
@Deprecated
private LocalDate revocationDate;

/**
* The card will be revoked at midnight UTC on the date specified.
* <p>
* [Optional]
* </p>
* Format: yyyy-MM-dd
*/
private LocalDate scheduledRevocationDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,31 @@ public abstract class CardDetailsResponse extends Resource {
* <p>
* [Optional]
* </p>
* Format: date (YYYY-MM-DD, time is midnight UTC)
* Example: 2027-03-12
* Format: yyyy-MM-dd
*
* @deprecated Use {@link #scheduledRevocationDate} instead.
*/
@Deprecated
protected LocalDate revocationDate;

/**
* The card will be revoked at midnight UTC on the date specified.
* <p>
* [Optional]
* </p>
* Format: yyyy-MM-dd
*/
protected LocalDate scheduledRevocationDate;

/**
* The date and time the card was last activated.
* <p>
* [Optional, nullable, read only]
* </p>
* Returns {@code null} if the card has never been activated.
*/
protected Instant lastActivatedOn;

/**
* When a card is renewed, the unique identifier of the first card in the renewal history.
* [Optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ public final class CardResponse extends Resource {
protected String reference;

protected Instant createdDate;

/**
* The date and time the card was last activated.
* <p>
* [Optional, nullable, read only]
* </p>
* Returns {@code null} if the card has never been activated.
*/
protected Instant lastActivatedOn;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.checkout.issuing.cards.responses.activate;

import com.checkout.common.Resource;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.Instant;

/**
* Response returned when activating a card.
*/
@Data
@EqualsAndHashCode(callSuper = true)
Comment thread
armando-rodriguez-cko marked this conversation as resolved.
Dismissed
@ToString(callSuper = true)
public final class ActivateCardResponse extends Resource {

/**
* The time the card was activated.
* <p>
* [Required]
* </p>
*/
private Instant lastActivatedOn;
}
Loading
Loading