Skip to content

Commit 8e45040

Browse files
feat(api): api update
1 parent 9879b8a commit 8e45040

7 files changed

Lines changed: 160 additions & 38 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 217
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-387c9e5ff5305d470ddf290a424b9d0f087fa295b56cf82265f2dfe8355a589a.yml
3-
openapi_spec_hash: 2c624b8535be90329028f6b10281a313
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-10d8a2e25ff71893e14a81477ef7dbbf761af689e6ff074e13da10729a75cc9d.yml
3+
openapi_spec_hash: 77a4f7c4b166e73a84c3b7f4e177631c
44
config_hash: e1885b38eded054b77308a024c5d80cc

src/increase/types/card_payment.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -582,23 +582,24 @@ class ElementCardAuthorizationVerificationCardholderAddress(BaseModel):
582582

583583
result: Literal[
584584
"not_checked",
585-
"postal_code_match_address_not_checked",
586585
"postal_code_match_address_no_match",
587586
"postal_code_no_match_address_match",
588587
"match",
589588
"no_match",
589+
"postal_code_match_address_not_checked",
590590
]
591591
"""The address verification result returned to the card network.
592592
593-
- `not_checked` - No address was provided in the authorization request.
594-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
595-
address was not verified.
593+
- `not_checked` - No address information was provided in the authorization
594+
request.
596595
- `postal_code_match_address_no_match` - Postal code matches, but the street
597-
address does not match.
596+
address does not match or was not provided.
598597
- `postal_code_no_match_address_match` - Postal code does not match, but the
599-
street address matches.
598+
street address matches or was not provided.
600599
- `match` - Postal code and street address match.
601600
- `no_match` - Postal code and street address do not match.
601+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
602+
address was not verified. (deprecated)
602603
"""
603604

604605

@@ -1149,23 +1150,24 @@ class ElementCardDeclineVerificationCardholderAddress(BaseModel):
11491150

11501151
result: Literal[
11511152
"not_checked",
1152-
"postal_code_match_address_not_checked",
11531153
"postal_code_match_address_no_match",
11541154
"postal_code_no_match_address_match",
11551155
"match",
11561156
"no_match",
1157+
"postal_code_match_address_not_checked",
11571158
]
11581159
"""The address verification result returned to the card network.
11591160
1160-
- `not_checked` - No address was provided in the authorization request.
1161-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
1162-
address was not verified.
1161+
- `not_checked` - No address information was provided in the authorization
1162+
request.
11631163
- `postal_code_match_address_no_match` - Postal code matches, but the street
1164-
address does not match.
1164+
address does not match or was not provided.
11651165
- `postal_code_no_match_address_match` - Postal code does not match, but the
1166-
street address matches.
1166+
street address matches or was not provided.
11671167
- `match` - Postal code and street address match.
11681168
- `no_match` - Postal code and street address do not match.
1169+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
1170+
address was not verified. (deprecated)
11691171
"""
11701172

11711173

@@ -3342,23 +3344,24 @@ class ElementCardValidationVerificationCardholderAddress(BaseModel):
33423344

33433345
result: Literal[
33443346
"not_checked",
3345-
"postal_code_match_address_not_checked",
33463347
"postal_code_match_address_no_match",
33473348
"postal_code_no_match_address_match",
33483349
"match",
33493350
"no_match",
3351+
"postal_code_match_address_not_checked",
33503352
]
33513353
"""The address verification result returned to the card network.
33523354
3353-
- `not_checked` - No address was provided in the authorization request.
3354-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
3355-
address was not verified.
3355+
- `not_checked` - No address information was provided in the authorization
3356+
request.
33563357
- `postal_code_match_address_no_match` - Postal code matches, but the street
3357-
address does not match.
3358+
address does not match or was not provided.
33583359
- `postal_code_no_match_address_match` - Postal code does not match, but the
3359-
street address matches.
3360+
street address matches or was not provided.
33603361
- `match` - Postal code and street address match.
33613362
- `no_match` - Postal code and street address do not match.
3363+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
3364+
address was not verified. (deprecated)
33623365
"""
33633366

33643367

src/increase/types/declined_transaction.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,23 +430,24 @@ class SourceCardDeclineVerificationCardholderAddress(BaseModel):
430430

431431
result: Literal[
432432
"not_checked",
433-
"postal_code_match_address_not_checked",
434433
"postal_code_match_address_no_match",
435434
"postal_code_no_match_address_match",
436435
"match",
437436
"no_match",
437+
"postal_code_match_address_not_checked",
438438
]
439439
"""The address verification result returned to the card network.
440440
441-
- `not_checked` - No address was provided in the authorization request.
442-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
443-
address was not verified.
441+
- `not_checked` - No address information was provided in the authorization
442+
request.
444443
- `postal_code_match_address_no_match` - Postal code matches, but the street
445-
address does not match.
444+
address does not match or was not provided.
446445
- `postal_code_no_match_address_match` - Postal code does not match, but the
447-
street address matches.
446+
street address matches or was not provided.
448447
- `match` - Postal code and street address match.
449448
- `no_match` - Postal code and street address do not match.
449+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
450+
address was not verified. (deprecated)
450451
"""
451452

452453

src/increase/types/pending_transaction.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,23 +380,24 @@ class SourceCardAuthorizationVerificationCardholderAddress(BaseModel):
380380

381381
result: Literal[
382382
"not_checked",
383-
"postal_code_match_address_not_checked",
384383
"postal_code_match_address_no_match",
385384
"postal_code_no_match_address_match",
386385
"match",
387386
"no_match",
387+
"postal_code_match_address_not_checked",
388388
]
389389
"""The address verification result returned to the card network.
390390
391-
- `not_checked` - No address was provided in the authorization request.
392-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
393-
address was not verified.
391+
- `not_checked` - No address information was provided in the authorization
392+
request.
394393
- `postal_code_match_address_no_match` - Postal code matches, but the street
395-
address does not match.
394+
address does not match or was not provided.
396395
- `postal_code_no_match_address_match` - Postal code does not match, but the
397-
street address matches.
396+
street address matches or was not provided.
398397
- `match` - Postal code and street address match.
399398
- `no_match` - Postal code and street address do not match.
399+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
400+
address was not verified. (deprecated)
400401
"""
401402

402403

src/increase/types/real_time_decision.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"CardAuthorizationAdditionalAmountsTransit",
2222
"CardAuthorizationAdditionalAmountsUnknown",
2323
"CardAuthorizationAdditionalAmountsVision",
24+
"CardAuthorizationDecline",
2425
"CardAuthorizationNetworkDetails",
2526
"CardAuthorizationNetworkDetailsVisa",
2627
"CardAuthorizationNetworkIdentifiers",
@@ -214,6 +215,11 @@ class CardAuthorizationAdditionalAmounts(BaseModel):
214215
"""The part of this transaction amount that was for vision-related services."""
215216

216217

218+
class CardAuthorizationDecline(BaseModel):
219+
reason: str
220+
"""The reason the authorization was declined."""
221+
222+
217223
class CardAuthorizationNetworkDetailsVisa(BaseModel):
218224
electronic_commerce_indicator: Optional[
219225
Literal[
@@ -422,23 +428,24 @@ class CardAuthorizationVerificationCardholderAddress(BaseModel):
422428

423429
result: Literal[
424430
"not_checked",
425-
"postal_code_match_address_not_checked",
426431
"postal_code_match_address_no_match",
427432
"postal_code_no_match_address_match",
428433
"match",
429434
"no_match",
435+
"postal_code_match_address_not_checked",
430436
]
431437
"""The address verification result returned to the card network.
432438
433-
- `not_checked` - No address was provided in the authorization request.
434-
- `postal_code_match_address_not_checked` - Postal code matches, but the street
435-
address was not verified.
439+
- `not_checked` - No address information was provided in the authorization
440+
request.
436441
- `postal_code_match_address_no_match` - Postal code matches, but the street
437-
address does not match.
442+
address does not match or was not provided.
438443
- `postal_code_no_match_address_match` - Postal code does not match, but the
439-
street address matches.
444+
street address matches or was not provided.
440445
- `match` - Postal code and street address match.
441446
- `no_match` - Postal code and street address do not match.
447+
- `postal_code_match_address_not_checked` - Postal code matches, but the street
448+
address was not verified. (deprecated)
442449
"""
443450

444451

@@ -477,6 +484,12 @@ class CardAuthorization(BaseModel):
477484
- `decline` - Decline the authorization.
478485
"""
479486

487+
decline: Optional[CardAuthorizationDecline] = None
488+
"""Present if and only if `decision` is `decline`.
489+
490+
Contains information related to the reason the authorization was declined.
491+
"""
492+
480493
digital_wallet_token_id: Optional[str] = None
481494
"""
482495
If the authorization was made via a Digital Wallet Token (such as an Apple Pay

src/increase/types/real_time_decision_action_params.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"CardAuthentication",
1010
"CardAuthenticationChallenge",
1111
"CardAuthorization",
12+
"CardAuthorizationApproval",
13+
"CardAuthorizationApprovalCardholderAddressVerificationResult",
14+
"CardAuthorizationDecline",
1215
"DigitalWalletAuthentication",
1316
"DigitalWalletAuthenticationSuccess",
1417
"DigitalWalletToken",
@@ -73,6 +76,73 @@ class CardAuthenticationChallenge(TypedDict, total=False):
7376
"""
7477

7578

79+
class CardAuthorizationApprovalCardholderAddressVerificationResult(TypedDict, total=False):
80+
line1: Required[Literal["match", "no_match"]]
81+
"""Your decision on the address line of the provided address.
82+
83+
- `match` - The cardholder address verification result matches the address
84+
provided by the merchant.
85+
- `no_match` - The cardholder address verification result does not match the
86+
address provided by the merchant.
87+
"""
88+
89+
postal_code: Required[Literal["match", "no_match"]]
90+
"""Your decision on the postal code of the provided address.
91+
92+
- `match` - The cardholder address verification result matches the address
93+
provided by the merchant.
94+
- `no_match` - The cardholder address verification result does not match the
95+
address provided by the merchant.
96+
"""
97+
98+
99+
class CardAuthorizationApproval(TypedDict, total=False):
100+
cardholder_address_verification_result: CardAuthorizationApprovalCardholderAddressVerificationResult
101+
"""Your decisions on whether or not each provided address component is a match.
102+
103+
Your response here is evaluated against the customer's provided `postal_code`
104+
and `line1`, and an appropriate network response is generated. For example, if
105+
you would like to approve all transactions for a given card, you can submit
106+
`match` for both `postal_code` and `line1` and Increase will generate an
107+
approval with an Address Verification System (AVS) code that will match all of
108+
the available address information, or will report that no check was performed if
109+
no address information is available. If you do not provide a response, the
110+
address verification result will be calculated by Increase using the available
111+
address information available on the card. If none is available, Increase will
112+
report that no check was performed.
113+
"""
114+
115+
116+
class CardAuthorizationDecline(TypedDict, total=False):
117+
reason: Required[
118+
Literal[
119+
"insufficient_funds",
120+
"transaction_never_allowed",
121+
"exceeds_approval_limit",
122+
"card_temporarily_disabled",
123+
"suspected_fraud",
124+
"other",
125+
]
126+
]
127+
"""The reason the card authorization was declined.
128+
129+
This translates to a specific decline code that is sent to the card network.
130+
131+
- `insufficient_funds` - The cardholder does not have sufficient funds to cover
132+
the transaction. The merchant may attempt to process the transaction again.
133+
- `transaction_never_allowed` - This type of transaction is not allowed for this
134+
card. This transaction should not be retried.
135+
- `exceeds_approval_limit` - The transaction amount exceeds the cardholder's
136+
approval limit. The merchant may attempt to process the transaction again.
137+
- `card_temporarily_disabled` - The card has been temporarily disabled or not
138+
yet activated. The merchant may attempt to process the transaction again.
139+
- `suspected_fraud` - The transaction is suspected to be fraudulent. The
140+
merchant may attempt to process the transaction again.
141+
- `other` - The transaction was declined for another reason. The merchant may
142+
attempt to process the transaction again. This should be used sparingly.
143+
"""
144+
145+
76146
class CardAuthorization(TypedDict, total=False):
77147
decision: Required[Literal["approve", "decline"]]
78148
"""Whether the card authorization should be approved or declined.
@@ -81,6 +151,20 @@ class CardAuthorization(TypedDict, total=False):
81151
- `decline` - Decline the authorization.
82152
"""
83153

154+
approval: CardAuthorizationApproval
155+
"""
156+
If your application approves the authorization, this contains metadata about
157+
your decision to approve. Your response here is advisory to the acquiring bank.
158+
The bank may choose to reverse the authorization if you approve the transaction
159+
but indicate the address does not match.
160+
"""
161+
162+
decline: CardAuthorizationDecline
163+
"""
164+
If your application declines the authorization, this contains details about the
165+
decline.
166+
"""
167+
84168
decline_reason: Literal[
85169
"insufficient_funds",
86170
"transaction_never_allowed",
@@ -92,6 +176,8 @@ class CardAuthorization(TypedDict, total=False):
92176
"""The reason the card authorization was declined.
93177
94178
This translates to a specific decline code that is sent to the card network.
179+
This field is deprecated, please transition to using the `decline` object as
180+
this field will be removed in a future release.
95181
96182
- `insufficient_funds` - The cardholder does not have sufficient funds to cover
97183
the transaction. The merchant may attempt to process the transaction again.
@@ -130,6 +216,10 @@ class DigitalWalletAuthentication(TypedDict, total=False):
130216
"""
131217

132218
success: DigitalWalletAuthenticationSuccess
219+
"""
220+
If your application was able to deliver the one-time passcode, this contains
221+
metadata about the delivery. Exactly one of `phone` or `email` must be provided.
222+
"""
133223

134224

135225
class DigitalWalletTokenApproval(TypedDict, total=False):

tests/api_resources/test_real_time_decisions.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ def test_method_action_with_all_params(self, client: Increase) -> None:
7070
card_authentication_challenge={"result": "success"},
7171
card_authorization={
7272
"decision": "approve",
73+
"approval": {
74+
"cardholder_address_verification_result": {
75+
"line1": "match",
76+
"postal_code": "no_match",
77+
}
78+
},
79+
"decline": {"reason": "insufficient_funds"},
7380
"decline_reason": "insufficient_funds",
7481
},
7582
digital_wallet_authentication={
@@ -179,6 +186,13 @@ async def test_method_action_with_all_params(self, async_client: AsyncIncrease)
179186
card_authentication_challenge={"result": "success"},
180187
card_authorization={
181188
"decision": "approve",
189+
"approval": {
190+
"cardholder_address_verification_result": {
191+
"line1": "match",
192+
"postal_code": "no_match",
193+
}
194+
},
195+
"decline": {"reason": "insufficient_funds"},
182196
"decline_reason": "insufficient_funds",
183197
},
184198
digital_wallet_authentication={

0 commit comments

Comments
 (0)