Skip to content

Commit 64373c1

Browse files
fix(issuing): document is_single_use on 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. This SDK has no typed issuing response classes, so this is a doc + test update.
1 parent 6a0371b commit 64373c1

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎checkout_sdk/issuing/issuing_client.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def update_card(self, card_id: str, update_card_request: UpdateCardRequest,
9393
code encryption_key_required.
9494
Returns:
9595
ResponseWrapper with the update response, including encrypted_cvv when requested.
96+
For a virtual card, the response may also include is_single_use, specifying whether
97+
the card is set to expire after a single use. Physical cards never send it.
9698
"""
9799
return self._api_client.patch(self.build_path(self.__ISSUING, self.__CARDS, card_id),
98100
self._sdk_authorization(),

‎tests/issuing/card_update_headers_wire_test.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,15 @@ def test_a_successful_update_without_the_headers_has_no_encrypted_cvv(self, mock
129129

130130
assert response.last_modified_date == '2026-06-01T10:00:00Z'
131131
assert not hasattr(response, 'encrypted_cvv')
132+
133+
def test_update_card_response_round_trips_is_single_use_for_virtual_cards(self, mock_sdk_configuration):
134+
"""The 2026-09-23 spec update split update-card-response into a virtual/physical
135+
discriminator; the virtual variant adds is_single_use."""
136+
client, _ = _build(mock_sdk_configuration, body='{'
137+
'"type":"virtual",'
138+
'"last_modified_date":"2026-06-01T10:00:00Z",'
139+
'"is_single_use":true}')
140+
141+
response = client.update_card('crd_123', UpdateCardRequest())
142+
143+
assert response.is_single_use is True

0 commit comments

Comments
 (0)