This commit is contained in:
Iliyan Angelov
2025-11-17 18:26:30 +02:00
parent 48353cde9c
commit 0c59fe1173
2535 changed files with 278997 additions and 2480 deletions

View File

@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from importlib import import_module
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from stripe.test_helpers.issuing._authorization_service import (
AuthorizationService as AuthorizationService,
)
from stripe.test_helpers.issuing._card_service import (
CardService as CardService,
)
from stripe.test_helpers.issuing._personalization_design_service import (
PersonalizationDesignService as PersonalizationDesignService,
)
from stripe.test_helpers.issuing._transaction_service import (
TransactionService as TransactionService,
)
# name -> (import_target, is_submodule)
_import_map = {
"AuthorizationService": (
"stripe.test_helpers.issuing._authorization_service",
False,
),
"CardService": ("stripe.test_helpers.issuing._card_service", False),
"PersonalizationDesignService": (
"stripe.test_helpers.issuing._personalization_design_service",
False,
),
"TransactionService": (
"stripe.test_helpers.issuing._transaction_service",
False,
),
}
if not TYPE_CHECKING:
def __getattr__(name):
try:
target, is_submodule = _import_map[name]
module = import_module(target)
if is_submodule:
return module
return getattr(
module,
name,
)
except KeyError:
raise AttributeError()

View File

@@ -0,0 +1,335 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from stripe._request_options import RequestOptions
from stripe.issuing._authorization import Authorization
from stripe.params.test_helpers.issuing._authorization_capture_params import (
AuthorizationCaptureParams,
)
from stripe.params.test_helpers.issuing._authorization_create_params import (
AuthorizationCreateParams,
)
from stripe.params.test_helpers.issuing._authorization_expire_params import (
AuthorizationExpireParams,
)
from stripe.params.test_helpers.issuing._authorization_finalize_amount_params import (
AuthorizationFinalizeAmountParams,
)
from stripe.params.test_helpers.issuing._authorization_increment_params import (
AuthorizationIncrementParams,
)
from stripe.params.test_helpers.issuing._authorization_respond_params import (
AuthorizationRespondParams,
)
from stripe.params.test_helpers.issuing._authorization_reverse_params import (
AuthorizationReverseParams,
)
class AuthorizationService(StripeService):
def create(
self,
params: "AuthorizationCreateParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Create a test-mode authorization.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations",
base_address="api",
params=params,
options=options,
),
)
async def create_async(
self,
params: "AuthorizationCreateParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Create a test-mode authorization.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations",
base_address="api",
params=params,
options=options,
),
)
def capture(
self,
authorization: str,
params: Optional["AuthorizationCaptureParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Capture a test-mode authorization.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/capture".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def capture_async(
self,
authorization: str,
params: Optional["AuthorizationCaptureParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Capture a test-mode authorization.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/capture".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
def expire(
self,
authorization: str,
params: Optional["AuthorizationExpireParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Expire a test-mode Authorization.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/expire".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def expire_async(
self,
authorization: str,
params: Optional["AuthorizationExpireParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Expire a test-mode Authorization.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/expire".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
def finalize_amount(
self,
authorization: str,
params: "AuthorizationFinalizeAmountParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def finalize_amount_async(
self,
authorization: str,
params: "AuthorizationFinalizeAmountParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
def respond(
self,
authorization: str,
params: "AuthorizationRespondParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def respond_async(
self,
authorization: str,
params: "AuthorizationRespondParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
def increment(
self,
authorization: str,
params: "AuthorizationIncrementParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Increment a test-mode Authorization.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/increment".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def increment_async(
self,
authorization: str,
params: "AuthorizationIncrementParams",
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Increment a test-mode Authorization.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/increment".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
def reverse(
self,
authorization: str,
params: Optional["AuthorizationReverseParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Reverse a test-mode Authorization.
"""
return cast(
"Authorization",
self._request(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)
async def reverse_async(
self,
authorization: str,
params: Optional["AuthorizationReverseParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Authorization":
"""
Reverse a test-mode Authorization.
"""
return cast(
"Authorization",
await self._request_async(
"post",
"/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format(
authorization=sanitize_id(authorization),
),
base_address="api",
params=params,
options=options,
),
)

View File

@@ -0,0 +1,247 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from stripe._request_options import RequestOptions
from stripe.issuing._card import Card
from stripe.params.test_helpers.issuing._card_deliver_card_params import (
CardDeliverCardParams,
)
from stripe.params.test_helpers.issuing._card_fail_card_params import (
CardFailCardParams,
)
from stripe.params.test_helpers.issuing._card_return_card_params import (
CardReturnCardParams,
)
from stripe.params.test_helpers.issuing._card_ship_card_params import (
CardShipCardParams,
)
from stripe.params.test_helpers.issuing._card_submit_card_params import (
CardSubmitCardParams,
)
class CardService(StripeService):
def deliver_card(
self,
card: str,
params: Optional["CardDeliverCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to delivered.
"""
return cast(
"Card",
self._request(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
async def deliver_card_async(
self,
card: str,
params: Optional["CardDeliverCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to delivered.
"""
return cast(
"Card",
await self._request_async(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
def fail_card(
self,
card: str,
params: Optional["CardFailCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to failure.
"""
return cast(
"Card",
self._request(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/fail".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
async def fail_card_async(
self,
card: str,
params: Optional["CardFailCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to failure.
"""
return cast(
"Card",
await self._request_async(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/fail".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
def return_card(
self,
card: str,
params: Optional["CardReturnCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to returned.
"""
return cast(
"Card",
self._request(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/return".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
async def return_card_async(
self,
card: str,
params: Optional["CardReturnCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to returned.
"""
return cast(
"Card",
await self._request_async(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/return".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
def ship_card(
self,
card: str,
params: Optional["CardShipCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to shipped.
"""
return cast(
"Card",
self._request(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/ship".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
async def ship_card_async(
self,
card: str,
params: Optional["CardShipCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to shipped.
"""
return cast(
"Card",
await self._request_async(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/ship".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
def submit_card(
self,
card: str,
params: Optional["CardSubmitCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version 2024-09-30.acacia' or later.
"""
return cast(
"Card",
self._request(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/submit".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)
async def submit_card_async(
self,
card: str,
params: Optional["CardSubmitCardParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Card":
"""
Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version 2024-09-30.acacia' or later.
"""
return cast(
"Card",
await self._request_async(
"post",
"/v1/test_helpers/issuing/cards/{card}/shipping/submit".format(
card=sanitize_id(card),
),
base_address="api",
params=params,
options=options,
),
)

View File

@@ -0,0 +1,153 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from stripe._request_options import RequestOptions
from stripe.issuing._personalization_design import PersonalizationDesign
from stripe.params.test_helpers.issuing._personalization_design_activate_params import (
PersonalizationDesignActivateParams,
)
from stripe.params.test_helpers.issuing._personalization_design_deactivate_params import (
PersonalizationDesignDeactivateParams,
)
from stripe.params.test_helpers.issuing._personalization_design_reject_params import (
PersonalizationDesignRejectParams,
)
class PersonalizationDesignService(StripeService):
def activate(
self,
personalization_design: str,
params: Optional["PersonalizationDesignActivateParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to active.
"""
return cast(
"PersonalizationDesign",
self._request(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)
async def activate_async(
self,
personalization_design: str,
params: Optional["PersonalizationDesignActivateParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to active.
"""
return cast(
"PersonalizationDesign",
await self._request_async(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)
def deactivate(
self,
personalization_design: str,
params: Optional["PersonalizationDesignDeactivateParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to inactive.
"""
return cast(
"PersonalizationDesign",
self._request(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)
async def deactivate_async(
self,
personalization_design: str,
params: Optional["PersonalizationDesignDeactivateParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to inactive.
"""
return cast(
"PersonalizationDesign",
await self._request_async(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)
def reject(
self,
personalization_design: str,
params: "PersonalizationDesignRejectParams",
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to rejected.
"""
return cast(
"PersonalizationDesign",
self._request(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)
async def reject_async(
self,
personalization_design: str,
params: "PersonalizationDesignRejectParams",
options: Optional["RequestOptions"] = None,
) -> "PersonalizationDesign":
"""
Updates the status of the specified testmode personalization design object to rejected.
"""
return cast(
"PersonalizationDesign",
await self._request_async(
"post",
"/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format(
personalization_design=sanitize_id(personalization_design),
),
base_address="api",
params=params,
options=options,
),
)

View File

@@ -0,0 +1,141 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from stripe._request_options import RequestOptions
from stripe.issuing._transaction import Transaction
from stripe.params.test_helpers.issuing._transaction_create_force_capture_params import (
TransactionCreateForceCaptureParams,
)
from stripe.params.test_helpers.issuing._transaction_create_unlinked_refund_params import (
TransactionCreateUnlinkedRefundParams,
)
from stripe.params.test_helpers.issuing._transaction_refund_params import (
TransactionRefundParams,
)
class TransactionService(StripeService):
def refund(
self,
transaction: str,
params: Optional["TransactionRefundParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Refund a test-mode Transaction.
"""
return cast(
"Transaction",
self._request(
"post",
"/v1/test_helpers/issuing/transactions/{transaction}/refund".format(
transaction=sanitize_id(transaction),
),
base_address="api",
params=params,
options=options,
),
)
async def refund_async(
self,
transaction: str,
params: Optional["TransactionRefundParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Refund a test-mode Transaction.
"""
return cast(
"Transaction",
await self._request_async(
"post",
"/v1/test_helpers/issuing/transactions/{transaction}/refund".format(
transaction=sanitize_id(transaction),
),
base_address="api",
params=params,
options=options,
),
)
def create_force_capture(
self,
params: "TransactionCreateForceCaptureParams",
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Allows the user to capture an arbitrary amount, also known as a forced capture.
"""
return cast(
"Transaction",
self._request(
"post",
"/v1/test_helpers/issuing/transactions/create_force_capture",
base_address="api",
params=params,
options=options,
),
)
async def create_force_capture_async(
self,
params: "TransactionCreateForceCaptureParams",
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Allows the user to capture an arbitrary amount, also known as a forced capture.
"""
return cast(
"Transaction",
await self._request_async(
"post",
"/v1/test_helpers/issuing/transactions/create_force_capture",
base_address="api",
params=params,
options=options,
),
)
def create_unlinked_refund(
self,
params: "TransactionCreateUnlinkedRefundParams",
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Allows the user to refund an arbitrary amount, also known as a unlinked refund.
"""
return cast(
"Transaction",
self._request(
"post",
"/v1/test_helpers/issuing/transactions/create_unlinked_refund",
base_address="api",
params=params,
options=options,
),
)
async def create_unlinked_refund_async(
self,
params: "TransactionCreateUnlinkedRefundParams",
options: Optional["RequestOptions"] = None,
) -> "Transaction":
"""
Allows the user to refund an arbitrary amount, also known as a unlinked refund.
"""
return cast(
"Transaction",
await self._request_async(
"post",
"/v1/test_helpers/issuing/transactions/create_unlinked_refund",
base_address="api",
params=params,
options=options,
),
)