Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1065

Merged
merged 5 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v562
v581
1 change: 1 addition & 0 deletions stripe/api_resources/issuing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
from stripe.api_resources.issuing.card import Card
from stripe.api_resources.issuing.cardholder import Cardholder
from stripe.api_resources.issuing.dispute import Dispute
from stripe.api_resources.issuing.token import Token
from stripe.api_resources.issuing.transaction import Transaction
2 changes: 2 additions & 0 deletions stripe/api_resources/issuing/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from stripe.api_resources.balance_transaction import BalanceTransaction
from stripe.api_resources.issuing.card import Card
from stripe.api_resources.issuing.cardholder import Cardholder
from stripe.api_resources.issuing.token import Token
from stripe.api_resources.issuing.transaction import Transaction


Expand Down Expand Up @@ -59,6 +60,7 @@ class Authorization(
pending_request: Optional[StripeObject]
request_history: List[StripeObject]
status: Literal["closed", "pending", "reversed"]
token: Optional[ExpandableField["Token"]]
transactions: List["Transaction"]
treasury: Optional[StripeObject]
verification_data: StripeObject
Expand Down
82 changes: 82 additions & 0 deletions stripe/api_resources/issuing/token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function

from stripe.api_resources.abstract import (
ListableAPIResource,
UpdateableAPIResource,
)
from stripe.api_resources.expandable_field import ExpandableField
from stripe.api_resources.list_object import ListObject
from stripe.stripe_object import StripeObject
from typing import Any, Optional, cast
from typing_extensions import Literal
from urllib.parse import quote_plus

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.issuing.card import Card


class Token(ListableAPIResource["Token"], UpdateableAPIResource["Token"]):
"""
An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can view and manage these tokens through Stripe.
"""

OBJECT_NAME = "issuing.token"
card: ExpandableField["Card"]
created: int
device_fingerprint: Optional[str]
id: str
last4: Optional[str]
livemode: bool
network: Literal["mastercard", "visa"]
network_data: Optional[StripeObject]
network_updated_at: int
object: Literal["issuing.token"]
status: Literal["active", "deleted", "requested", "suspended"]
wallet_provider: Optional[
Literal["apple_pay", "google_pay", "samsung_pay"]
]

@classmethod
def list(
cls,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
) -> ListObject["Token"]:
result = cls._static_request(
"get",
cls.class_url(),
api_key=api_key,
stripe_version=stripe_version,
stripe_account=stripe_account,
params=params,
)
if not isinstance(result, ListObject):

raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)

return result

@classmethod
def modify(cls, id, **params: Any) -> "Token":
url = "%s/%s" % (cls.class_url(), quote_plus(id))
return cast(
"Token",
cls._static_request("post", url, params=params),
)

@classmethod
def retrieve(
cls, id: str, api_key: Optional[str] = None, **params: Any
) -> "Token":
instance = cls(id, api_key, **params)
instance.refresh()
return instance
2 changes: 2 additions & 0 deletions stripe/api_resources/issuing/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from stripe.api_resources.issuing.card import Card
from stripe.api_resources.issuing.cardholder import Cardholder
from stripe.api_resources.issuing.dispute import Dispute
from stripe.api_resources.issuing.token import Token


class Transaction(
Expand Down Expand Up @@ -55,6 +56,7 @@ class Transaction(
metadata: Dict[str, str]
object: Literal["issuing.transaction"]
purchase_details: Optional[StripeObject]
token: Optional[ExpandableField["Token"]]
treasury: Optional[StripeObject]
type: Literal["capture", "refund"]
wallet: Optional[Literal["apple_pay", "google_pay", "samsung_pay"]]
Expand Down
15 changes: 14 additions & 1 deletion stripe/api_resources/payment_method_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ class PaymentMethodConfiguration(
UpdateableAPIResource["PaymentMethodConfiguration"],
):
"""
An object detailing payment method configurations.
PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios.

There are two types of PaymentMethodConfigurations. Which is used depends on the [charge type](https://stripe.com/docs/connect/charges):

**Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect.

**Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter.

Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account's associated child configuration. Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API.

Related guides:
- [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations)
- [Multiple payment method configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs)
- [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations)
"""

OBJECT_NAME = "payment_method_configuration"
Expand Down
23 changes: 11 additions & 12 deletions stripe/api_resources/setup_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,24 @@ class SetupIntent(
):
"""
A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.

Create a SetupIntent as soon as you're ready to collect your customer's payment credentials.
Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid.
The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides
Create a SetupIntent when you're ready to collect your customer's payment credentials.
Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides
you through the setup process.

Successful SetupIntents result in payment credentials that are optimized for future payments.
For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through
[Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection
in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents).
If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success,
it will automatically attach the resulting payment method to that Customer.
For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
[Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection
to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents).
If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
it automatically attaches the resulting payment method to that Customer after successful setup.
We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.
PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.

By using SetupIntents, you ensure that your customers experience the minimum set of required friction,
even as regulations change over time.
By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.

Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents)
"""
Expand Down
22 changes: 11 additions & 11 deletions stripe/api_resources/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ class Token(CreateableAPIResource["Token"]):
Tokenization is the process Stripe uses to collect sensitive card or bank
account details, or personally identifiable information (PII), directly from
your customers in a secure manner. A token representing this information is
returned to your server to use. You should use our
returned to your server to use. Use our
[recommended payments integrations](https://stripe.com/docs/payments) to perform this process
client-side. This ensures that no sensitive card data touches your server,
on the client-side. This guarantees that no sensitive card data touches your server,
and allows your integration to operate in a PCI-compliant way.

If you cannot use client-side tokenization, you can also create tokens using
the API with either your publishable or secret API key. Keep in mind that if
your integration uses this method, you are responsible for any PCI compliance
that may be required, and you must keep your secret API key safe. Unlike with
client-side tokenization, your customer's information is not sent directly to
Stripe, so we cannot determine how it is handled or stored.
If you can't use client-side tokenization, you can also create tokens using
the API with either your publishable or secret API key. If
your integration uses this method, you're responsible for any PCI compliance
that it might require, and you must keep your secret API key safe. Unlike with
client-side tokenization, your customer's information isn't sent directly to
Stripe, so we can't determine how it's handled or stored.

Tokens cannot be stored or used more than once. To store card or bank account
information for later use, you can create [Customer](https://stripe.com/docs/api#customers)
objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that
You can't store or use tokens more than once. To store card or bank account
information for later use, create [Customer](https://stripe.com/docs/api#customers)
objects or [Custom accounts](https://stripe.com/docs/api#external_accounts).
[Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,
performs best with integrations that use client-side tokenization.
"""
Expand Down
1 change: 1 addition & 0 deletions stripe/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
api_resources.issuing.Card.OBJECT_NAME: api_resources.issuing.Card,
api_resources.issuing.Cardholder.OBJECT_NAME: api_resources.issuing.Cardholder,
api_resources.issuing.Dispute.OBJECT_NAME: api_resources.issuing.Dispute,
api_resources.issuing.Token.OBJECT_NAME: api_resources.issuing.Token,
api_resources.issuing.Transaction.OBJECT_NAME: api_resources.issuing.Transaction,
api_resources.LineItem.OBJECT_NAME: api_resources.LineItem,
api_resources.LoginLink.OBJECT_NAME: api_resources.LoginLink,
Expand Down