Skip to content

Commit 951c5a2

Browse files
feat(api): api update
1 parent ec597de commit 951c5a2

File tree

4 files changed

+161
-3
lines changed

4 files changed

+161
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 236
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f46fe8b546ee1a4ad24918ef0803f48e6586e061d5445ae1aeb6abc7b8cf64a3.yml
3-
openapi_spec_hash: 440b743a615d5ecc832affd6c3154809
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4699565aad7b519933c0f8789762574139b2ca7ad57c008b747eebe6a3f91eec.yml
3+
openapi_spec_hash: 3c7cf6b8f8d59763cbdac549682f61c3
44
config_hash: dda988c5565c2f15cc708122984d7691

src/increase/resources/simulations/card_tokens.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def create(
5050
capabilities: Iterable[card_token_create_params.Capability] | Omit = omit,
5151
expiration: Union[str, date] | Omit = omit,
5252
last4: str | Omit = omit,
53+
outcome: card_token_create_params.Outcome | Omit = omit,
5354
prefix: str | Omit = omit,
5455
primary_account_number_length: int | Omit = omit,
5556
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -70,6 +71,8 @@ def create(
7071
7172
last4: The last 4 digits of the card number.
7273
74+
outcome: The outcome to simulate for card push transfers using this token.
75+
7376
prefix: The prefix of the card number, usually the first 8 digits.
7477
7578
primary_account_number_length: The total length of the card number, including prefix and last4.
@@ -91,6 +94,7 @@ def create(
9194
"capabilities": capabilities,
9295
"expiration": expiration,
9396
"last4": last4,
97+
"outcome": outcome,
9498
"prefix": prefix,
9599
"primary_account_number_length": primary_account_number_length,
96100
},
@@ -133,6 +137,7 @@ async def create(
133137
capabilities: Iterable[card_token_create_params.Capability] | Omit = omit,
134138
expiration: Union[str, date] | Omit = omit,
135139
last4: str | Omit = omit,
140+
outcome: card_token_create_params.Outcome | Omit = omit,
136141
prefix: str | Omit = omit,
137142
primary_account_number_length: int | Omit = omit,
138143
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -153,6 +158,8 @@ async def create(
153158
154159
last4: The last 4 digits of the card number.
155160
161+
outcome: The outcome to simulate for card push transfers using this token.
162+
156163
prefix: The prefix of the card number, usually the first 8 digits.
157164
158165
primary_account_number_length: The total length of the card number, including prefix and last4.
@@ -174,6 +181,7 @@ async def create(
174181
"capabilities": capabilities,
175182
"expiration": expiration,
176183
"last4": last4,
184+
"outcome": outcome,
177185
"prefix": prefix,
178186
"primary_account_number_length": primary_account_number_length,
179187
},

src/increase/types/simulations/card_token_create_params.py

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ..._utils import PropertyInfo
1010

11-
__all__ = ["CardTokenCreateParams", "Capability"]
11+
__all__ = ["CardTokenCreateParams", "Capability", "Outcome", "OutcomeDecline"]
1212

1313

1414
class CardTokenCreateParams(TypedDict, total=False):
@@ -21,6 +21,9 @@ class CardTokenCreateParams(TypedDict, total=False):
2121
last4: str
2222
"""The last 4 digits of the card number."""
2323

24+
outcome: Outcome
25+
"""The outcome to simulate for card push transfers using this token."""
26+
2427
prefix: str
2528
"""The prefix of the card number, usually the first 8 digits."""
2629

@@ -49,3 +52,142 @@ class Capability(TypedDict, total=False):
4952
- `visa` - Visa and Interlink
5053
- `mastercard` - Mastercard and Maestro
5154
"""
55+
56+
57+
class OutcomeDecline(TypedDict, total=False):
58+
"""If the result is declined, the details of the decline."""
59+
60+
reason: Literal[
61+
"do_not_honor",
62+
"activity_count_limit_exceeded",
63+
"refer_to_card_issuer",
64+
"refer_to_card_issuer_special_condition",
65+
"invalid_merchant",
66+
"pick_up_card",
67+
"error",
68+
"pick_up_card_special",
69+
"invalid_transaction",
70+
"invalid_amount",
71+
"invalid_account_number",
72+
"no_such_issuer",
73+
"re_enter_transaction",
74+
"no_credit_account",
75+
"pick_up_card_lost",
76+
"pick_up_card_stolen",
77+
"closed_account",
78+
"insufficient_funds",
79+
"no_checking_account",
80+
"no_savings_account",
81+
"expired_card",
82+
"transaction_not_permitted_to_cardholder",
83+
"transaction_not_allowed_at_terminal",
84+
"suspected_fraud",
85+
"activity_amount_limit_exceeded",
86+
"restricted_card",
87+
"security_violation",
88+
"transaction_does_not_fulfill_anti_money_laundering_requirement",
89+
"blocked_first_use",
90+
"credit_issuer_unavailable",
91+
"negative_card_verification_value_results",
92+
"issuer_unavailable",
93+
"financial_institution_cannot_be_found",
94+
"transaction_cannot_be_completed",
95+
"duplicate_transaction",
96+
"system_malfunction",
97+
"additional_customer_authentication_required",
98+
"surcharge_amount_not_permitted",
99+
"decline_for_cvv2_failure",
100+
"stop_payment_order",
101+
"revocation_of_authorization_order",
102+
"revocation_of_all_authorizations_order",
103+
]
104+
"""The reason for the decline.
105+
106+
- `do_not_honor` - The card issuer has declined the transaction without
107+
providing a specific reason.
108+
- `activity_count_limit_exceeded` - The number of transactions for the card has
109+
exceeded the limit set by the issuer.
110+
- `refer_to_card_issuer` - The card issuer requires the cardholder to contact
111+
them for further information regarding the transaction.
112+
- `refer_to_card_issuer_special_condition` - The card issuer requires the
113+
cardholder to contact them due to a special condition related to the
114+
transaction.
115+
- `invalid_merchant` - The merchant is not valid for this transaction.
116+
- `pick_up_card` - The card should be retained by the terminal.
117+
- `error` - An error occurred during processing of the transaction.
118+
- `pick_up_card_special` - The card should be retained by the terminal due to a
119+
special condition.
120+
- `invalid_transaction` - The transaction is invalid and cannot be processed.
121+
- `invalid_amount` - The amount of the transaction is invalid.
122+
- `invalid_account_number` - The account number provided is invalid.
123+
- `no_such_issuer` - The issuer of the card could not be found.
124+
- `re_enter_transaction` - The transaction should be re-entered for processing.
125+
- `no_credit_account` - There is no credit account associated with the card.
126+
- `pick_up_card_lost` - The card should be retained by the terminal because it
127+
has been reported lost.
128+
- `pick_up_card_stolen` - The card should be retained by the terminal because it
129+
has been reported stolen.
130+
- `closed_account` - The account associated with the card has been closed.
131+
- `insufficient_funds` - There are insufficient funds in the account to complete
132+
the transaction.
133+
- `no_checking_account` - There is no checking account associated with the card.
134+
- `no_savings_account` - There is no savings account associated with the card.
135+
- `expired_card` - The card has expired and cannot be used for transactions.
136+
- `transaction_not_permitted_to_cardholder` - The transaction is not permitted
137+
for this cardholder.
138+
- `transaction_not_allowed_at_terminal` - The transaction is not allowed at this
139+
terminal.
140+
- `suspected_fraud` - The transaction has been flagged as suspected fraud and
141+
cannot be processed.
142+
- `activity_amount_limit_exceeded` - The amount of activity on the card has
143+
exceeded the limit set by the issuer.
144+
- `restricted_card` - The card has restrictions that prevent it from being used
145+
for this transaction.
146+
- `security_violation` - A security violation has occurred, preventing the
147+
transaction from being processed.
148+
- `transaction_does_not_fulfill_anti_money_laundering_requirement` - The
149+
transaction does not meet the anti-money laundering requirements set by the
150+
issuer.
151+
- `blocked_first_use` - The first use of the card has been blocked by the
152+
issuer.
153+
- `credit_issuer_unavailable` - The credit issuer is currently unavailable to
154+
process the transaction.
155+
- `negative_card_verification_value_results` - The card verification value (CVV)
156+
results were negative, indicating a potential issue with the card.
157+
- `issuer_unavailable` - The issuer of the card is currently unavailable to
158+
process the transaction.
159+
- `financial_institution_cannot_be_found` - The financial institution associated
160+
with the card could not be found.
161+
- `transaction_cannot_be_completed` - The transaction cannot be completed due to
162+
an unspecified reason.
163+
- `duplicate_transaction` - The transaction is a duplicate of a previous
164+
transaction and cannot be processed again.
165+
- `system_malfunction` - A system malfunction occurred, preventing the
166+
transaction from being processed.
167+
- `additional_customer_authentication_required` - Additional customer
168+
authentication is required to complete the transaction.
169+
- `surcharge_amount_not_permitted` - The surcharge amount applied to the
170+
transaction is not permitted by the issuer.
171+
- `decline_for_cvv2_failure` - The transaction was declined due to a failure in
172+
verifying the CVV2 code.
173+
- `stop_payment_order` - A stop payment order has been placed on this
174+
transaction.
175+
- `revocation_of_authorization_order` - An order has been placed to revoke
176+
authorization for this transaction.
177+
- `revocation_of_all_authorizations_order` - An order has been placed to revoke
178+
all authorizations for this cardholder.
179+
"""
180+
181+
182+
class Outcome(TypedDict, total=False):
183+
"""The outcome to simulate for card push transfers using this token."""
184+
185+
result: Required[Literal["approve", "decline"]]
186+
"""Whether card push transfers or validations will be approved or declined.
187+
188+
- `approve` - Any card push transfers or validations will be approved.
189+
- `decline` - Any card push transfers or validations will be declined.
190+
"""
191+
192+
decline: OutcomeDecline
193+
"""If the result is declined, the details of the decline."""

tests/api_resources/simulations/test_card_tokens.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def test_method_create_with_all_params(self, client: Increase) -> None:
3535
],
3636
expiration=parse_date("2019-12-27"),
3737
last4="1234",
38+
outcome={
39+
"result": "approve",
40+
"decline": {"reason": "do_not_honor"},
41+
},
3842
prefix="41234567",
3943
primary_account_number_length=16,
4044
)
@@ -83,6 +87,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease)
8387
],
8488
expiration=parse_date("2019-12-27"),
8589
last4="1234",
90+
outcome={
91+
"result": "approve",
92+
"decline": {"reason": "do_not_honor"},
93+
},
8694
prefix="41234567",
8795
primary_account_number_length=16,
8896
)

0 commit comments

Comments
 (0)