Skip to content

Commit 51accbb

Browse files
feat(issuing): add scheduled_revocation_date, last_activated_on and update-card status (#674)
* feat(issuing): add scheduled_revocation_date, last_activated_on and update-card status Swagger 2026-09-17: add-card-request and update-card-request gain scheduled_revocation_date (replaces deprecated revocation_date); update-card-request gains status to reactivate an inactive/suspended card; activate-card-response, add-card-response and get-card-response gain last_activated_on; update-card-response drops encrypted_cvv (last_modified_date and _links stay). activateCard/activateCardSync now return a typed ActivateCardResponse instead of VoidResponse. * fix(issuing): add isSingleUse to update-card-response for virtual cards Swagger 2026-09-23 split update-card-response into a virtual/physical discriminator; the virtual variant adds is_single_use (specifies whether the card is set to expire after a single use). Physical cards never send it.
1 parent 043e3db commit 51accbb

14 files changed

Lines changed: 416 additions & 90 deletions

‎src/main/java/com/checkout/issuing/IssuingClient.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.checkout.issuing.cards.requests.update.UpdateCardRequest;
2121
import com.checkout.issuing.cards.responses.CardDetailsResponse;
2222
import com.checkout.issuing.cards.responses.CardResponse;
23+
import com.checkout.issuing.cards.responses.activate.ActivateCardResponse;
2324
import com.checkout.issuing.cards.responses.GetDigitalCardResponse;
2425
import com.checkout.issuing.cards.responses.credentials.CardCredentialsResponse;
2526
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentDetailsResponse;
@@ -87,7 +88,7 @@ public interface IssuingClient {
8788

8889
CompletableFuture<ThreeDSEnrollmentDetailsResponse> getCardThreeDSDetails(String cardId);
8990

90-
CompletableFuture<VoidResponse> activateCard(String cardId);
91+
CompletableFuture<ActivateCardResponse> activateCard(String cardId);
9192

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

@@ -229,7 +230,7 @@ CompletableFuture<CardAuthorizationReversalResponse> simulateReversal(
229230

230231
ThreeDSEnrollmentDetailsResponse getCardThreeDSDetailsSync(String cardId);
231232

232-
VoidResponse activateCardSync(String cardId);
233+
ActivateCardResponse activateCardSync(String cardId);
233234

234235
CardCredentialsResponse getCardCredentialsSync(String cardId, CardCredentialsQuery queryFilter);
235236

‎src/main/java/com/checkout/issuing/IssuingClientImpl.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.checkout.issuing.cards.requests.update.UpdateCardRequest;
2626
import com.checkout.issuing.cards.responses.CardDetailsResponse;
2727
import com.checkout.issuing.cards.responses.CardResponse;
28+
import com.checkout.issuing.cards.responses.activate.ActivateCardResponse;
2829
import com.checkout.issuing.cards.responses.credentials.CardCredentialsResponse;
2930
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentDetailsResponse;
3031
import com.checkout.issuing.cards.responses.enrollment.ThreeDSEnrollmentResponse;
@@ -254,12 +255,12 @@ public CompletableFuture<ThreeDSEnrollmentDetailsResponse> getCardThreeDSDetails
254255
}
255256

256257
@Override
257-
public CompletableFuture<VoidResponse> activateCard(final String cardId) {
258+
public CompletableFuture<ActivateCardResponse> activateCard(final String cardId) {
258259
validateParams("cardId", cardId);
259260
return apiClient.postAsync(
260261
buildPath(ISSUING_PATH, CARDS_PATH, cardId, ACTIVATE_PATH),
261262
sdkAuthorization(),
262-
VoidResponse.class,
263+
ActivateCardResponse.class,
263264
null,
264265
null
265266
);
@@ -845,12 +846,12 @@ public ThreeDSEnrollmentDetailsResponse getCardThreeDSDetailsSync(final String c
845846
}
846847

847848
@Override
848-
public VoidResponse activateCardSync(final String cardId) {
849+
public ActivateCardResponse activateCardSync(final String cardId) {
849850
validateCardId(cardId);
850851
return apiClient.post(
851852
buildPath(ISSUING_PATH, CARDS_PATH, cardId, ACTIVATE_PATH),
852853
sdkAuthorization(),
853-
VoidResponse.class,
854+
ActivateCardResponse.class,
854855
null,
855856
null
856857
);

‎src/main/java/com/checkout/issuing/cards/requests/create/CardRequest.java‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,23 @@ public abstract class CardRequest {
4949
* <p>
5050
* [Optional]
5151
* </p>
52-
* Format: date (YYYY-MM-DD, time is midnight UTC)
53-
* Example: 2027-03-12
52+
* Format: yyyy-MM-dd
53+
*
54+
* @deprecated Use {@link #scheduledRevocationDate} instead. If both fields are provided,
55+
* {@code scheduledRevocationDate} overrides this value.
5456
*/
57+
@Deprecated
5558
private LocalDate revocationDate;
5659

60+
/**
61+
* The card will be revoked at midnight UTC on the date specified.
62+
* <p>
63+
* [Optional]
64+
* </p>
65+
* Format: yyyy-MM-dd
66+
*/
67+
private LocalDate scheduledRevocationDate;
68+
5769
/**
5870
* Date scheduling the card's first activation. Only applies to the initial activation of a
5971
* card. Two formats are supported: date only (YYYY-MM-DD, treated as midnight UTC), or date

‎src/main/java/com/checkout/issuing/cards/requests/create/PhysicalCardRequest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ private PhysicalCardRequest(final String cardholderId,
3232
final ShippingInstruction shippingInstructions,
3333
final IssuingCardMetadata metadata,
3434
final LocalDate revocationDate,
35+
final LocalDate scheduledRevocationDate,
3536
final String scheduledActivationDate) {
3637
super(CardType.PHYSICAL, cardholderId, lifetime, reference, cardProductId, displayName, activateCard);
3738
this.shippingInstructions = shippingInstructions;
3839
setMetadata(metadata);
3940
setRevocationDate(revocationDate);
41+
setScheduledRevocationDate(scheduledRevocationDate);
4042
setScheduledActivationDate(scheduledActivationDate);
4143
}
4244

‎src/main/java/com/checkout/issuing/cards/requests/create/VirtualCardRequest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ private VirtualCardRequest(final String cardholderId,
5353
final Boolean isSingleUse,
5454
final IssuingCardMetadata metadata,
5555
final LocalDate revocationDate,
56+
final LocalDate scheduledRevocationDate,
5657
final String scheduledActivationDate,
5758
final List<ReturnCredentialsType> returnCredentials,
5859
final List<String> controlProfiles,
@@ -64,6 +65,7 @@ private VirtualCardRequest(final String cardholderId,
6465
this.controls = controls;
6566
setMetadata(metadata);
6667
setRevocationDate(revocationDate);
68+
setScheduledRevocationDate(scheduledRevocationDate);
6769
setScheduledActivationDate(scheduledActivationDate);
6870
}
6971
}

‎src/main/java/com/checkout/issuing/cards/requests/update/UpdateCardRequest.java‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.checkout.issuing.cards.requests.update;
22

3+
import com.checkout.issuing.cards.CardStatus;
34
import lombok.AllArgsConstructor;
45
import lombok.Builder;
56
import lombok.Data;
@@ -13,6 +14,17 @@
1314
@AllArgsConstructor
1415
public final class UpdateCardRequest {
1516

17+
/**
18+
* Set the card's status to {@code ACTIVE} to reactivate an {@code INACTIVE} or
19+
* {@code SUSPENDED} card. The API only accepts {@code active} for this field.
20+
* <p>
21+
* [Optional]
22+
* </p>
23+
* Mutually exclusive with {@link #scheduledActivationDate}: submitting both results in the
24+
* API error {@code scheduled_activation_date_conflicts_with_activation}.
25+
*/
26+
private CardStatus status;
27+
1628
/**
1729
* Your reference.
1830
* [Optional]
@@ -58,8 +70,20 @@ public final class UpdateCardRequest {
5870
* <p>
5971
* [Optional]
6072
* </p>
61-
* Format: date (YYYY-MM-DD, time is midnight UTC)
62-
* Example: 2027-03-12
73+
* Format: yyyy-MM-dd
74+
*
75+
* @deprecated Use {@link #scheduledRevocationDate} instead. If both fields are provided,
76+
* {@code scheduledRevocationDate} overrides this value.
6377
*/
78+
@Deprecated
6479
private LocalDate revocationDate;
80+
81+
/**
82+
* The card will be revoked at midnight UTC on the date specified.
83+
* <p>
84+
* [Optional]
85+
* </p>
86+
* Format: yyyy-MM-dd
87+
*/
88+
private LocalDate scheduledRevocationDate;
6589
}

‎src/main/java/com/checkout/issuing/cards/responses/CardDetailsResponse.java‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,31 @@ public abstract class CardDetailsResponse extends Resource {
164164
* <p>
165165
* [Optional]
166166
* </p>
167-
* Format: date (YYYY-MM-DD, time is midnight UTC)
168-
* Example: 2027-03-12
167+
* Format: yyyy-MM-dd
168+
*
169+
* @deprecated Use {@link #scheduledRevocationDate} instead.
169170
*/
171+
@Deprecated
170172
protected LocalDate revocationDate;
171173

174+
/**
175+
* The card will be revoked at midnight UTC on the date specified.
176+
* <p>
177+
* [Optional]
178+
* </p>
179+
* Format: yyyy-MM-dd
180+
*/
181+
protected LocalDate scheduledRevocationDate;
182+
183+
/**
184+
* The date and time the card was last activated.
185+
* <p>
186+
* [Optional, nullable, read only]
187+
* </p>
188+
* Returns {@code null} if the card has never been activated.
189+
*/
190+
protected Instant lastActivatedOn;
191+
172192
/**
173193
* When a card is renewed, the unique identifier of the first card in the renewal history.
174194
* [Optional]

‎src/main/java/com/checkout/issuing/cards/responses/CardResponse.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,13 @@ public final class CardResponse extends Resource {
3131
protected String reference;
3232

3333
protected Instant createdDate;
34+
35+
/**
36+
* The date and time the card was last activated.
37+
* <p>
38+
* [Optional, nullable, read only]
39+
* </p>
40+
* Returns {@code null} if the card has never been activated.
41+
*/
42+
protected Instant lastActivatedOn;
3443
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.checkout.issuing.cards.responses.activate;
2+
3+
import com.checkout.common.Resource;
4+
import lombok.Data;
5+
import lombok.EqualsAndHashCode;
6+
import lombok.ToString;
7+
8+
import java.time.Instant;
9+
10+
/**
11+
* Response returned when activating a card.
12+
*/
13+
@Data
14+
@EqualsAndHashCode(callSuper = true)
15+
@ToString(callSuper = true)
16+
public final class ActivateCardResponse extends Resource {
17+
18+
/**
19+
* The time the card was activated.
20+
* <p>
21+
* [Required]
22+
* </p>
23+
*/
24+
private Instant lastActivatedOn;
25+
}

0 commit comments

Comments
 (0)