Skip to content

Commit

Permalink
Update generated code (#1052)
Browse files Browse the repository at this point in the history
* Update generated code for v527

* Update generated code for v528

* Update generated code for v530

* Update generated code for v531

* Update generated code for v532

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and richardm-stripe authored Sep 15, 2023
1 parent 57f8b88 commit 89971a7
Show file tree
Hide file tree
Showing 12 changed files with 420 additions and 23 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v525
v532
3 changes: 3 additions & 0 deletions stripe/api_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
from stripe.api_resources.payment_intent import PaymentIntent
from stripe.api_resources.payment_link import PaymentLink
from stripe.api_resources.payment_method import PaymentMethod
from stripe.api_resources.payment_method_configuration import (
PaymentMethodConfiguration,
)
from stripe.api_resources.payment_method_domain import PaymentMethodDomain
from stripe.api_resources.payout import Payout
from stripe.api_resources.person import Person
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class BalanceTransaction(ListableAPIResource["BalanceTransaction"]):
"""
Balance transactions represent funds moving through your Stripe account.
They're created for every type of transaction that comes into or flows out of your Stripe account balance.
Stripe creates them for every type of transaction that enters or leaves your Stripe account balance.
Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types)
"""
Expand Down
1 change: 1 addition & 0 deletions stripe/api_resources/checkout/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class Session(
payment_intent: Optional[ExpandableField["PaymentIntent"]]
payment_link: Optional[ExpandableField["PaymentLink"]]
payment_method_collection: Optional[Literal["always", "if_required"]]
payment_method_configuration_details: Optional[StripeObject]
payment_method_options: Optional[StripeObject]
payment_method_types: List[str]
payment_status: Literal["no_payment_required", "paid", "unpaid"]
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Customer(
UpdateableAPIResource["Customer"],
):
"""
This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer.
This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.
Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment)
"""
Expand Down
6 changes: 2 additions & 4 deletions stripe/api_resources/dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ class Dispute(
):
"""
A dispute occurs when a customer questions your charge with their card issuer.
When this happens, you're given the opportunity to respond to the dispute with
evidence that shows that the charge is legitimate. You can find more
information about the dispute process in our [Disputes and
Fraud](https://stripe.com/docs/disputes) documentation.
When this happens, you have the opportunity to respond to the dispute with
evidence that shows that the charge is legitimate.
Related guide: [Disputes and fraud](https://stripe.com/docs/disputes)
"""
Expand Down
33 changes: 17 additions & 16 deletions stripe/api_resources/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,33 @@ class Event(ListableAPIResource["Event"]):
Events are our way of letting you know when something interesting happens in
your account. When an interesting event occurs, we create a new `Event`
object. For example, when a charge succeeds, we create a `charge.succeeded`
event; and when an invoice payment attempt fails, we create an
`invoice.payment_failed` event. Note that many API requests may cause multiple
events to be created. For example, if you create a new subscription for a
customer, you will receive both a `customer.subscription.created` event and a
event, and when an invoice payment attempt fails, we create an
`invoice.payment_failed` event. Certain API requests might create multiple
events. For example, if you create a new subscription for a
customer, you receive both a `customer.subscription.created` event and a
`charge.succeeded` event.
Events occur when the state of another API resource changes. The state of that
resource at the time of the change is embedded in the event's data field. For
example, a `charge.succeeded` event will contain a charge, and an
`invoice.payment_failed` event will contain an invoice.
Events occur when the state of another API resource changes. The event's data
field embeds the resource's state at the time of the change. For
example, a `charge.succeeded` event contains a charge, and an
`invoice.payment_failed` event contains an invoice.
As with other API resources, you can use endpoints to retrieve an
[individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events)
from the API. We also have a separate
[webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the
`Event` objects directly to an endpoint on your server. Webhooks are managed
in your
[account settings](https://dashboard.stripe.com/account/webhooks),
and our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up.
`Event` objects directly to an endpoint on your server. You can manage
webhooks in your
[account settings](https://dashboard.stripe.com/account/webhooks). Learn how
to [listen for events]
(/docs/webhooks) so that your integration can automatically trigger reactions.
When using [Connect](https://stripe.com/docs/connect), you can also receive notifications of
events that occur in connected accounts. For these events, there will be an
When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications
that occur in connected accounts. For these events, there's an
additional `account` attribute in the received `Event` object.
**NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is
guaranteed only for 30 days.
We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event)
for 30 days.
"""

OBJECT_NAME = "event"
Expand Down
1 change: 1 addition & 0 deletions stripe/api_resources/payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class PaymentIntent(
object: Literal["payment_intent"]
on_behalf_of: Optional[ExpandableField["Account"]]
payment_method: Optional[ExpandableField["PaymentMethod"]]
payment_method_configuration_details: Optional[StripeObject]
payment_method_options: Optional[StripeObject]
payment_method_types: List[str]
processing: Optional[StripeObject]
Expand Down
130 changes: 130 additions & 0 deletions stripe/api_resources/payment_method_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function

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


class PaymentMethodConfiguration(
CreateableAPIResource["PaymentMethodConfiguration"],
ListableAPIResource["PaymentMethodConfiguration"],
UpdateableAPIResource["PaymentMethodConfiguration"],
):
"""
An object detailing payment method configurations.
"""

OBJECT_NAME = "payment_method_configuration"
acss_debit: StripeObject
active: bool
affirm: StripeObject
afterpay_clearpay: StripeObject
alipay: StripeObject
apple_pay: StripeObject
application: Optional[str]
au_becs_debit: StripeObject
bacs_debit: StripeObject
bancontact: StripeObject
blik: StripeObject
boleto: StripeObject
card: StripeObject
cartes_bancaires: StripeObject
cashapp: StripeObject
eps: StripeObject
fpx: StripeObject
giropay: StripeObject
google_pay: StripeObject
grabpay: StripeObject
id: str
id_bank_transfer: StripeObject
ideal: StripeObject
is_default: bool
jcb: StripeObject
klarna: StripeObject
konbini: StripeObject
link: StripeObject
livemode: bool
multibanco: StripeObject
name: str
netbanking: StripeObject
object: Literal["payment_method_configuration"]
oxxo: StripeObject
p24: StripeObject
parent: Optional[str]
pay_by_bank: StripeObject
paynow: StripeObject
paypal: StripeObject
promptpay: StripeObject
sepa_debit: StripeObject
sofort: StripeObject
upi: StripeObject
us_bank_account: StripeObject
wechat_pay: StripeObject

@classmethod
def create(
cls,
api_key=None,
idempotency_key=None,
stripe_version=None,
stripe_account=None,
**params
) -> "PaymentMethodConfiguration":
return cast(
"PaymentMethodConfiguration",
cls._static_request(
"post",
cls.class_url(),
api_key,
idempotency_key,
stripe_version,
stripe_account,
params,
),
)

@classmethod
def list(
cls, api_key=None, stripe_version=None, stripe_account=None, **params
) -> ListObject["PaymentMethodConfiguration"]:
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) -> "PaymentMethodConfiguration":
url = "%s/%s" % (cls.class_url(), quote_plus(id))
return cast(
"PaymentMethodConfiguration",
cls._static_request("post", url, params=params),
)

@classmethod
def retrieve(
cls, id, api_key=None, **params
) -> "PaymentMethodConfiguration":
instance = cls(id, api_key, **params)
instance.refresh()
return instance
1 change: 1 addition & 0 deletions stripe/api_resources/setup_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class SetupIntent(
object: Literal["setup_intent"]
on_behalf_of: Optional[ExpandableField["Account"]]
payment_method: Optional[ExpandableField["PaymentMethod"]]
payment_method_configuration_details: Optional[StripeObject]
payment_method_options: Optional[StripeObject]
payment_method_types: List[str]
single_use_mandate: Optional[ExpandableField["Mandate"]]
Expand Down
1 change: 1 addition & 0 deletions stripe/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
api_resources.PaymentIntent.OBJECT_NAME: api_resources.PaymentIntent,
api_resources.PaymentLink.OBJECT_NAME: api_resources.PaymentLink,
api_resources.PaymentMethod.OBJECT_NAME: api_resources.PaymentMethod,
api_resources.PaymentMethodConfiguration.OBJECT_NAME: api_resources.PaymentMethodConfiguration,
api_resources.PaymentMethodDomain.OBJECT_NAME: api_resources.PaymentMethodDomain,
api_resources.Payout.OBJECT_NAME: api_resources.Payout,
api_resources.Person.OBJECT_NAME: api_resources.Person,
Expand Down
Loading

0 comments on commit 89971a7

Please sign in to comment.