Improve subscription UI with large tier buttons
- Replace dropdown tier selection with attractive visual buttons - Add tier-button CSS with hover effects and selection states - Remove 'or pay by card' divider from subscription form for cleaner UI - Update JavaScript to handle tier button selection events - Fix Stripe module import conflict by renaming stripe directory to stripe_config - Add responsive grid layout for tier buttons on mobile devices
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe.terminal._configuration import Configuration as Configuration
|
||||
from stripe.terminal._configuration_service import (
|
||||
ConfigurationService as ConfigurationService,
|
||||
)
|
||||
from stripe.terminal._connection_token import (
|
||||
ConnectionToken as ConnectionToken,
|
||||
)
|
||||
from stripe.terminal._connection_token_service import (
|
||||
ConnectionTokenService as ConnectionTokenService,
|
||||
)
|
||||
from stripe.terminal._location import Location as Location
|
||||
from stripe.terminal._location_service import (
|
||||
LocationService as LocationService,
|
||||
)
|
||||
from stripe.terminal._reader import Reader as Reader
|
||||
from stripe.terminal._reader_service import ReaderService as ReaderService
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,926 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._list_object import ListObject
|
||||
from stripe._request_options import RequestOptions
|
||||
from stripe._stripe_service import StripeService
|
||||
from stripe._util import sanitize_id
|
||||
from stripe.terminal._configuration import Configuration
|
||||
from typing import List, cast
|
||||
from typing_extensions import Literal, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ConfigurationService(StripeService):
|
||||
class CreateParams(TypedDict):
|
||||
bbpos_wisepos_e: NotRequired[
|
||||
"ConfigurationService.CreateParamsBbposWiseposE"
|
||||
]
|
||||
"""
|
||||
An object containing device type specific settings for BBPOS WisePOS E readers
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
name: NotRequired[str]
|
||||
"""
|
||||
Name of the configuration
|
||||
"""
|
||||
offline: NotRequired[
|
||||
"Literal['']|ConfigurationService.CreateParamsOffline"
|
||||
]
|
||||
"""
|
||||
Configurations for collecting transactions offline.
|
||||
"""
|
||||
reboot_window: NotRequired[
|
||||
"ConfigurationService.CreateParamsRebootWindow"
|
||||
]
|
||||
"""
|
||||
Reboot time settings for readers that support customized reboot time configuration.
|
||||
"""
|
||||
stripe_s700: NotRequired["ConfigurationService.CreateParamsStripeS700"]
|
||||
"""
|
||||
An object containing device type specific settings for Stripe S700 readers
|
||||
"""
|
||||
tipping: NotRequired[
|
||||
"Literal['']|ConfigurationService.CreateParamsTipping"
|
||||
]
|
||||
"""
|
||||
Tipping configurations for readers supporting on-reader tips
|
||||
"""
|
||||
verifone_p400: NotRequired[
|
||||
"ConfigurationService.CreateParamsVerifoneP400"
|
||||
]
|
||||
"""
|
||||
An object containing device type specific settings for Verifone P400 readers
|
||||
"""
|
||||
|
||||
class CreateParamsBbposWiseposE(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
class CreateParamsOffline(TypedDict):
|
||||
enabled: bool
|
||||
"""
|
||||
Determines whether to allow transactions to be collected while reader is offline. Defaults to false.
|
||||
"""
|
||||
|
||||
class CreateParamsRebootWindow(TypedDict):
|
||||
end_hour: int
|
||||
"""
|
||||
Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour.
|
||||
"""
|
||||
start_hour: int
|
||||
"""
|
||||
Integer between 0 to 23 that represents the start hour of the reboot time window.
|
||||
"""
|
||||
|
||||
class CreateParamsStripeS700(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
class CreateParamsTipping(TypedDict):
|
||||
aud: NotRequired["ConfigurationService.CreateParamsTippingAud"]
|
||||
"""
|
||||
Tipping configuration for AUD
|
||||
"""
|
||||
cad: NotRequired["ConfigurationService.CreateParamsTippingCad"]
|
||||
"""
|
||||
Tipping configuration for CAD
|
||||
"""
|
||||
chf: NotRequired["ConfigurationService.CreateParamsTippingChf"]
|
||||
"""
|
||||
Tipping configuration for CHF
|
||||
"""
|
||||
czk: NotRequired["ConfigurationService.CreateParamsTippingCzk"]
|
||||
"""
|
||||
Tipping configuration for CZK
|
||||
"""
|
||||
dkk: NotRequired["ConfigurationService.CreateParamsTippingDkk"]
|
||||
"""
|
||||
Tipping configuration for DKK
|
||||
"""
|
||||
eur: NotRequired["ConfigurationService.CreateParamsTippingEur"]
|
||||
"""
|
||||
Tipping configuration for EUR
|
||||
"""
|
||||
gbp: NotRequired["ConfigurationService.CreateParamsTippingGbp"]
|
||||
"""
|
||||
Tipping configuration for GBP
|
||||
"""
|
||||
hkd: NotRequired["ConfigurationService.CreateParamsTippingHkd"]
|
||||
"""
|
||||
Tipping configuration for HKD
|
||||
"""
|
||||
myr: NotRequired["ConfigurationService.CreateParamsTippingMyr"]
|
||||
"""
|
||||
Tipping configuration for MYR
|
||||
"""
|
||||
nok: NotRequired["ConfigurationService.CreateParamsTippingNok"]
|
||||
"""
|
||||
Tipping configuration for NOK
|
||||
"""
|
||||
nzd: NotRequired["ConfigurationService.CreateParamsTippingNzd"]
|
||||
"""
|
||||
Tipping configuration for NZD
|
||||
"""
|
||||
sek: NotRequired["ConfigurationService.CreateParamsTippingSek"]
|
||||
"""
|
||||
Tipping configuration for SEK
|
||||
"""
|
||||
sgd: NotRequired["ConfigurationService.CreateParamsTippingSgd"]
|
||||
"""
|
||||
Tipping configuration for SGD
|
||||
"""
|
||||
usd: NotRequired["ConfigurationService.CreateParamsTippingUsd"]
|
||||
"""
|
||||
Tipping configuration for USD
|
||||
"""
|
||||
|
||||
class CreateParamsTippingAud(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingCad(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingChf(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingCzk(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingDkk(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingEur(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingGbp(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingHkd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingMyr(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingNok(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingNzd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingSek(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingSgd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsTippingUsd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class CreateParamsVerifoneP400(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
class DeleteParams(TypedDict):
|
||||
pass
|
||||
|
||||
class ListParams(TypedDict):
|
||||
ending_before: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
is_account_default: NotRequired[bool]
|
||||
"""
|
||||
if present, only return the account default or non-default configurations.
|
||||
"""
|
||||
limit: NotRequired[int]
|
||||
"""
|
||||
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
"""
|
||||
starting_after: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
"""
|
||||
|
||||
class RetrieveParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
|
||||
class UpdateParams(TypedDict):
|
||||
bbpos_wisepos_e: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsBbposWiseposE"
|
||||
]
|
||||
"""
|
||||
An object containing device type specific settings for BBPOS WisePOS E readers
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
name: NotRequired[str]
|
||||
"""
|
||||
Name of the configuration
|
||||
"""
|
||||
offline: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsOffline"
|
||||
]
|
||||
"""
|
||||
Configurations for collecting transactions offline.
|
||||
"""
|
||||
reboot_window: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsRebootWindow"
|
||||
]
|
||||
"""
|
||||
Reboot time settings for readers that support customized reboot time configuration.
|
||||
"""
|
||||
stripe_s700: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsStripeS700"
|
||||
]
|
||||
"""
|
||||
An object containing device type specific settings for Stripe S700 readers
|
||||
"""
|
||||
tipping: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsTipping"
|
||||
]
|
||||
"""
|
||||
Tipping configurations for readers supporting on-reader tips
|
||||
"""
|
||||
verifone_p400: NotRequired[
|
||||
"Literal['']|ConfigurationService.UpdateParamsVerifoneP400"
|
||||
]
|
||||
"""
|
||||
An object containing device type specific settings for Verifone P400 readers
|
||||
"""
|
||||
|
||||
class UpdateParamsBbposWiseposE(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
class UpdateParamsOffline(TypedDict):
|
||||
enabled: bool
|
||||
"""
|
||||
Determines whether to allow transactions to be collected while reader is offline. Defaults to false.
|
||||
"""
|
||||
|
||||
class UpdateParamsRebootWindow(TypedDict):
|
||||
end_hour: int
|
||||
"""
|
||||
Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour.
|
||||
"""
|
||||
start_hour: int
|
||||
"""
|
||||
Integer between 0 to 23 that represents the start hour of the reboot time window.
|
||||
"""
|
||||
|
||||
class UpdateParamsStripeS700(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
class UpdateParamsTipping(TypedDict):
|
||||
aud: NotRequired["ConfigurationService.UpdateParamsTippingAud"]
|
||||
"""
|
||||
Tipping configuration for AUD
|
||||
"""
|
||||
cad: NotRequired["ConfigurationService.UpdateParamsTippingCad"]
|
||||
"""
|
||||
Tipping configuration for CAD
|
||||
"""
|
||||
chf: NotRequired["ConfigurationService.UpdateParamsTippingChf"]
|
||||
"""
|
||||
Tipping configuration for CHF
|
||||
"""
|
||||
czk: NotRequired["ConfigurationService.UpdateParamsTippingCzk"]
|
||||
"""
|
||||
Tipping configuration for CZK
|
||||
"""
|
||||
dkk: NotRequired["ConfigurationService.UpdateParamsTippingDkk"]
|
||||
"""
|
||||
Tipping configuration for DKK
|
||||
"""
|
||||
eur: NotRequired["ConfigurationService.UpdateParamsTippingEur"]
|
||||
"""
|
||||
Tipping configuration for EUR
|
||||
"""
|
||||
gbp: NotRequired["ConfigurationService.UpdateParamsTippingGbp"]
|
||||
"""
|
||||
Tipping configuration for GBP
|
||||
"""
|
||||
hkd: NotRequired["ConfigurationService.UpdateParamsTippingHkd"]
|
||||
"""
|
||||
Tipping configuration for HKD
|
||||
"""
|
||||
myr: NotRequired["ConfigurationService.UpdateParamsTippingMyr"]
|
||||
"""
|
||||
Tipping configuration for MYR
|
||||
"""
|
||||
nok: NotRequired["ConfigurationService.UpdateParamsTippingNok"]
|
||||
"""
|
||||
Tipping configuration for NOK
|
||||
"""
|
||||
nzd: NotRequired["ConfigurationService.UpdateParamsTippingNzd"]
|
||||
"""
|
||||
Tipping configuration for NZD
|
||||
"""
|
||||
sek: NotRequired["ConfigurationService.UpdateParamsTippingSek"]
|
||||
"""
|
||||
Tipping configuration for SEK
|
||||
"""
|
||||
sgd: NotRequired["ConfigurationService.UpdateParamsTippingSgd"]
|
||||
"""
|
||||
Tipping configuration for SGD
|
||||
"""
|
||||
usd: NotRequired["ConfigurationService.UpdateParamsTippingUsd"]
|
||||
"""
|
||||
Tipping configuration for USD
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingAud(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingCad(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingChf(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingCzk(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingDkk(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingEur(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingGbp(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingHkd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingMyr(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingNok(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingNzd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingSek(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingSgd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsTippingUsd(TypedDict):
|
||||
fixed_amounts: NotRequired[List[int]]
|
||||
"""
|
||||
Fixed amounts displayed when collecting a tip
|
||||
"""
|
||||
percentages: NotRequired[List[int]]
|
||||
"""
|
||||
Percentages displayed when collecting a tip
|
||||
"""
|
||||
smart_tip_threshold: NotRequired[int]
|
||||
"""
|
||||
Below this amount, fixed amounts will be displayed; above it, percentages will be displayed
|
||||
"""
|
||||
|
||||
class UpdateParamsVerifoneP400(TypedDict):
|
||||
splashscreen: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
A File ID representing an image you would like displayed on the reader.
|
||||
"""
|
||||
|
||||
def delete(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Deletes a Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
self._request(
|
||||
"delete",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def delete_async(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Deletes a Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
await self._request_async(
|
||||
"delete",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def retrieve(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Retrieves a Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def retrieve_async(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Retrieves a Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Updates a new Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def update_async(
|
||||
self,
|
||||
configuration: str,
|
||||
params: "ConfigurationService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Updates a new Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/configurations/{configuration}".format(
|
||||
configuration=sanitize_id(configuration),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
params: "ConfigurationService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Configuration]:
|
||||
"""
|
||||
Returns a list of Configuration objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Configuration],
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/configurations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def list_async(
|
||||
self,
|
||||
params: "ConfigurationService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Configuration]:
|
||||
"""
|
||||
Returns a list of Configuration objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Configuration],
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/configurations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def create(
|
||||
self,
|
||||
params: "ConfigurationService.CreateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Creates a new Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/configurations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def create_async(
|
||||
self,
|
||||
params: "ConfigurationService.CreateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Configuration:
|
||||
"""
|
||||
Creates a new Configuration object.
|
||||
"""
|
||||
return cast(
|
||||
Configuration,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/configurations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._createable_api_resource import CreateableAPIResource
|
||||
from stripe._request_options import RequestOptions
|
||||
from typing import ClassVar, List, Optional, cast
|
||||
from typing_extensions import Literal, NotRequired, Unpack
|
||||
|
||||
|
||||
class ConnectionToken(CreateableAPIResource["ConnectionToken"]):
|
||||
"""
|
||||
A Connection Token is used by the Stripe Terminal SDK to connect to a reader.
|
||||
|
||||
Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations)
|
||||
"""
|
||||
|
||||
OBJECT_NAME: ClassVar[Literal["terminal.connection_token"]] = (
|
||||
"terminal.connection_token"
|
||||
)
|
||||
|
||||
class CreateParams(RequestOptions):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
location: NotRequired[str]
|
||||
"""
|
||||
The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens).
|
||||
"""
|
||||
|
||||
location: Optional[str]
|
||||
"""
|
||||
The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens).
|
||||
"""
|
||||
object: Literal["terminal.connection_token"]
|
||||
"""
|
||||
String representing the object's type. Objects of the same type share the same value.
|
||||
"""
|
||||
secret: str
|
||||
"""
|
||||
Your application should pass this token to the Stripe Terminal SDK.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def create(
|
||||
cls, **params: Unpack["ConnectionToken.CreateParams"]
|
||||
) -> "ConnectionToken":
|
||||
"""
|
||||
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
||||
"""
|
||||
return cast(
|
||||
"ConnectionToken",
|
||||
cls._static_request(
|
||||
"post",
|
||||
cls.class_url(),
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def create_async(
|
||||
cls, **params: Unpack["ConnectionToken.CreateParams"]
|
||||
) -> "ConnectionToken":
|
||||
"""
|
||||
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
||||
"""
|
||||
return cast(
|
||||
"ConnectionToken",
|
||||
await cls._static_request_async(
|
||||
"post",
|
||||
cls.class_url(),
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,59 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._request_options import RequestOptions
|
||||
from stripe._stripe_service import StripeService
|
||||
from stripe.terminal._connection_token import ConnectionToken
|
||||
from typing import List, cast
|
||||
from typing_extensions import NotRequired, TypedDict
|
||||
|
||||
|
||||
class ConnectionTokenService(StripeService):
|
||||
class CreateParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
location: NotRequired[str]
|
||||
"""
|
||||
The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens).
|
||||
"""
|
||||
|
||||
def create(
|
||||
self,
|
||||
params: "ConnectionTokenService.CreateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ConnectionToken:
|
||||
"""
|
||||
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
||||
"""
|
||||
return cast(
|
||||
ConnectionToken,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/connection_tokens",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def create_async(
|
||||
self,
|
||||
params: "ConnectionTokenService.CreateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ConnectionToken:
|
||||
"""
|
||||
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
||||
"""
|
||||
return cast(
|
||||
ConnectionToken,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/connection_tokens",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,432 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._createable_api_resource import CreateableAPIResource
|
||||
from stripe._deletable_api_resource import DeletableAPIResource
|
||||
from stripe._list_object import ListObject
|
||||
from stripe._listable_api_resource import ListableAPIResource
|
||||
from stripe._request_options import RequestOptions
|
||||
from stripe._stripe_object import StripeObject
|
||||
from stripe._updateable_api_resource import UpdateableAPIResource
|
||||
from stripe._util import class_method_variant, sanitize_id
|
||||
from typing import ClassVar, Dict, List, Optional, cast, overload
|
||||
from typing_extensions import Literal, NotRequired, TypedDict, Unpack
|
||||
|
||||
|
||||
class Location(
|
||||
CreateableAPIResource["Location"],
|
||||
DeletableAPIResource["Location"],
|
||||
ListableAPIResource["Location"],
|
||||
UpdateableAPIResource["Location"],
|
||||
):
|
||||
"""
|
||||
A Location represents a grouping of readers.
|
||||
|
||||
Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations)
|
||||
"""
|
||||
|
||||
OBJECT_NAME: ClassVar[Literal["terminal.location"]] = "terminal.location"
|
||||
|
||||
class Address(StripeObject):
|
||||
city: Optional[str]
|
||||
"""
|
||||
City, district, suburb, town, or village.
|
||||
"""
|
||||
country: Optional[str]
|
||||
"""
|
||||
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
"""
|
||||
line1: Optional[str]
|
||||
"""
|
||||
Address line 1 (e.g., street, PO Box, or company name).
|
||||
"""
|
||||
line2: Optional[str]
|
||||
"""
|
||||
Address line 2 (e.g., apartment, suite, unit, or building).
|
||||
"""
|
||||
postal_code: Optional[str]
|
||||
"""
|
||||
ZIP or postal code.
|
||||
"""
|
||||
state: Optional[str]
|
||||
"""
|
||||
State, county, province, or region.
|
||||
"""
|
||||
|
||||
class CreateParams(RequestOptions):
|
||||
address: "Location.CreateParamsAddress"
|
||||
"""
|
||||
The full address of the location.
|
||||
"""
|
||||
configuration_overrides: NotRequired[str]
|
||||
"""
|
||||
The ID of a configuration that will be used to customize all readers in this location.
|
||||
"""
|
||||
display_name: str
|
||||
"""
|
||||
A name for the location.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
|
||||
class CreateParamsAddress(TypedDict):
|
||||
city: NotRequired[str]
|
||||
"""
|
||||
City, district, suburb, town, or village.
|
||||
"""
|
||||
country: str
|
||||
"""
|
||||
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
"""
|
||||
line1: NotRequired[str]
|
||||
"""
|
||||
Address line 1 (e.g., street, PO Box, or company name).
|
||||
"""
|
||||
line2: NotRequired[str]
|
||||
"""
|
||||
Address line 2 (e.g., apartment, suite, unit, or building).
|
||||
"""
|
||||
postal_code: NotRequired[str]
|
||||
"""
|
||||
ZIP or postal code.
|
||||
"""
|
||||
state: NotRequired[str]
|
||||
"""
|
||||
State, county, province, or region.
|
||||
"""
|
||||
|
||||
class DeleteParams(RequestOptions):
|
||||
pass
|
||||
|
||||
class ListParams(RequestOptions):
|
||||
ending_before: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
limit: NotRequired[int]
|
||||
"""
|
||||
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
"""
|
||||
starting_after: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
"""
|
||||
|
||||
class ModifyParams(RequestOptions):
|
||||
address: NotRequired["Location.ModifyParamsAddress"]
|
||||
"""
|
||||
The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location.
|
||||
"""
|
||||
configuration_overrides: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
The ID of a configuration that will be used to customize all readers in this location.
|
||||
"""
|
||||
display_name: NotRequired[str]
|
||||
"""
|
||||
A name for the location.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
|
||||
class ModifyParamsAddress(TypedDict):
|
||||
city: NotRequired[str]
|
||||
"""
|
||||
City, district, suburb, town, or village.
|
||||
"""
|
||||
country: NotRequired[str]
|
||||
"""
|
||||
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
"""
|
||||
line1: NotRequired[str]
|
||||
"""
|
||||
Address line 1 (e.g., street, PO Box, or company name).
|
||||
"""
|
||||
line2: NotRequired[str]
|
||||
"""
|
||||
Address line 2 (e.g., apartment, suite, unit, or building).
|
||||
"""
|
||||
postal_code: NotRequired[str]
|
||||
"""
|
||||
ZIP or postal code.
|
||||
"""
|
||||
state: NotRequired[str]
|
||||
"""
|
||||
State, county, province, or region.
|
||||
"""
|
||||
|
||||
class RetrieveParams(RequestOptions):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
|
||||
address: Address
|
||||
configuration_overrides: Optional[str]
|
||||
"""
|
||||
The ID of a configuration that will be used to customize all readers in this location.
|
||||
"""
|
||||
display_name: str
|
||||
"""
|
||||
The display name of the location.
|
||||
"""
|
||||
id: str
|
||||
"""
|
||||
Unique identifier for the object.
|
||||
"""
|
||||
livemode: bool
|
||||
"""
|
||||
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
"""
|
||||
metadata: Dict[str, str]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
"""
|
||||
object: Literal["terminal.location"]
|
||||
"""
|
||||
String representing the object's type. Objects of the same type share the same value.
|
||||
"""
|
||||
deleted: Optional[Literal[True]]
|
||||
"""
|
||||
Always true for a deleted object
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location":
|
||||
"""
|
||||
Creates a new Location object.
|
||||
For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
||||
"""
|
||||
return cast(
|
||||
"Location",
|
||||
cls._static_request(
|
||||
"post",
|
||||
cls.class_url(),
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def create_async(
|
||||
cls, **params: Unpack["Location.CreateParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Creates a new Location object.
|
||||
For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
||||
"""
|
||||
return cast(
|
||||
"Location",
|
||||
await cls._static_request_async(
|
||||
"post",
|
||||
cls.class_url(),
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _cls_delete(
|
||||
cls, sid: str, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
url = "%s/%s" % (cls.class_url(), sanitize_id(sid))
|
||||
return cast(
|
||||
"Location",
|
||||
cls._static_request(
|
||||
"delete",
|
||||
url,
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@overload
|
||||
@staticmethod
|
||||
def delete(
|
||||
sid: str, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def delete(self, **params: Unpack["Location.DeleteParams"]) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
...
|
||||
|
||||
@class_method_variant("_cls_delete")
|
||||
def delete( # pyright: ignore[reportGeneralTypeIssues]
|
||||
self, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
return self._request_and_refresh(
|
||||
"delete",
|
||||
self.instance_url(),
|
||||
params=params,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def _cls_delete_async(
|
||||
cls, sid: str, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
url = "%s/%s" % (cls.class_url(), sanitize_id(sid))
|
||||
return cast(
|
||||
"Location",
|
||||
await cls._static_request_async(
|
||||
"delete",
|
||||
url,
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@overload
|
||||
@staticmethod
|
||||
async def delete_async(
|
||||
sid: str, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
async def delete_async(
|
||||
self, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
...
|
||||
|
||||
@class_method_variant("_cls_delete_async")
|
||||
async def delete_async( # pyright: ignore[reportGeneralTypeIssues]
|
||||
self, **params: Unpack["Location.DeleteParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
return await self._request_and_refresh_async(
|
||||
"delete",
|
||||
self.instance_url(),
|
||||
params=params,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def list(
|
||||
cls, **params: Unpack["Location.ListParams"]
|
||||
) -> ListObject["Location"]:
|
||||
"""
|
||||
Returns a list of Location objects.
|
||||
"""
|
||||
result = cls._static_request(
|
||||
"get",
|
||||
cls.class_url(),
|
||||
params=params,
|
||||
)
|
||||
if not isinstance(result, ListObject):
|
||||
raise TypeError(
|
||||
"Expected list object from API, got %s"
|
||||
% (type(result).__name__)
|
||||
)
|
||||
|
||||
return result
|
||||
|
||||
@classmethod
|
||||
async def list_async(
|
||||
cls, **params: Unpack["Location.ListParams"]
|
||||
) -> ListObject["Location"]:
|
||||
"""
|
||||
Returns a list of Location objects.
|
||||
"""
|
||||
result = await cls._static_request_async(
|
||||
"get",
|
||||
cls.class_url(),
|
||||
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: str, **params: Unpack["Location.ModifyParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
|
||||
return cast(
|
||||
"Location",
|
||||
cls._static_request(
|
||||
"post",
|
||||
url,
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def modify_async(
|
||||
cls, id: str, **params: Unpack["Location.ModifyParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
|
||||
return cast(
|
||||
"Location",
|
||||
await cls._static_request_async(
|
||||
"post",
|
||||
url,
|
||||
params=params,
|
||||
),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def retrieve(
|
||||
cls, id: str, **params: Unpack["Location.RetrieveParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Retrieves a Location object.
|
||||
"""
|
||||
instance = cls(id, **params)
|
||||
instance.refresh()
|
||||
return instance
|
||||
|
||||
@classmethod
|
||||
async def retrieve_async(
|
||||
cls, id: str, **params: Unpack["Location.RetrieveParams"]
|
||||
) -> "Location":
|
||||
"""
|
||||
Retrieves a Location object.
|
||||
"""
|
||||
instance = cls(id, **params)
|
||||
await instance.refresh_async()
|
||||
return instance
|
||||
|
||||
_inner_class_types = {"address": Address}
|
||||
@@ -0,0 +1,354 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._list_object import ListObject
|
||||
from stripe._request_options import RequestOptions
|
||||
from stripe._stripe_service import StripeService
|
||||
from stripe._util import sanitize_id
|
||||
from stripe.terminal._location import Location
|
||||
from typing import Dict, List, cast
|
||||
from typing_extensions import Literal, NotRequired, TypedDict
|
||||
|
||||
|
||||
class LocationService(StripeService):
|
||||
class CreateParams(TypedDict):
|
||||
address: "LocationService.CreateParamsAddress"
|
||||
"""
|
||||
The full address of the location.
|
||||
"""
|
||||
configuration_overrides: NotRequired[str]
|
||||
"""
|
||||
The ID of a configuration that will be used to customize all readers in this location.
|
||||
"""
|
||||
display_name: str
|
||||
"""
|
||||
A name for the location.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
|
||||
class CreateParamsAddress(TypedDict):
|
||||
city: NotRequired[str]
|
||||
"""
|
||||
City, district, suburb, town, or village.
|
||||
"""
|
||||
country: str
|
||||
"""
|
||||
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
"""
|
||||
line1: NotRequired[str]
|
||||
"""
|
||||
Address line 1 (e.g., street, PO Box, or company name).
|
||||
"""
|
||||
line2: NotRequired[str]
|
||||
"""
|
||||
Address line 2 (e.g., apartment, suite, unit, or building).
|
||||
"""
|
||||
postal_code: NotRequired[str]
|
||||
"""
|
||||
ZIP or postal code.
|
||||
"""
|
||||
state: NotRequired[str]
|
||||
"""
|
||||
State, county, province, or region.
|
||||
"""
|
||||
|
||||
class DeleteParams(TypedDict):
|
||||
pass
|
||||
|
||||
class ListParams(TypedDict):
|
||||
ending_before: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
limit: NotRequired[int]
|
||||
"""
|
||||
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
"""
|
||||
starting_after: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
"""
|
||||
|
||||
class RetrieveParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
|
||||
class UpdateParams(TypedDict):
|
||||
address: NotRequired["LocationService.UpdateParamsAddress"]
|
||||
"""
|
||||
The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location.
|
||||
"""
|
||||
configuration_overrides: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
The ID of a configuration that will be used to customize all readers in this location.
|
||||
"""
|
||||
display_name: NotRequired[str]
|
||||
"""
|
||||
A name for the location.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
|
||||
class UpdateParamsAddress(TypedDict):
|
||||
city: NotRequired[str]
|
||||
"""
|
||||
City, district, suburb, town, or village.
|
||||
"""
|
||||
country: NotRequired[str]
|
||||
"""
|
||||
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
"""
|
||||
line1: NotRequired[str]
|
||||
"""
|
||||
Address line 1 (e.g., street, PO Box, or company name).
|
||||
"""
|
||||
line2: NotRequired[str]
|
||||
"""
|
||||
Address line 2 (e.g., apartment, suite, unit, or building).
|
||||
"""
|
||||
postal_code: NotRequired[str]
|
||||
"""
|
||||
ZIP or postal code.
|
||||
"""
|
||||
state: NotRequired[str]
|
||||
"""
|
||||
State, county, province, or region.
|
||||
"""
|
||||
|
||||
def delete(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
self._request(
|
||||
"delete",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def delete_async(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Deletes a Location object.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
await self._request_async(
|
||||
"delete",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def retrieve(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Retrieves a Location object.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def retrieve_async(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Retrieves a Location object.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def update_async(
|
||||
self,
|
||||
location: str,
|
||||
params: "LocationService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/locations/{location}".format(
|
||||
location=sanitize_id(location),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
params: "LocationService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Location]:
|
||||
"""
|
||||
Returns a list of Location objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Location],
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/locations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def list_async(
|
||||
self,
|
||||
params: "LocationService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Location]:
|
||||
"""
|
||||
Returns a list of Location objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Location],
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/locations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def create(
|
||||
self,
|
||||
params: "LocationService.CreateParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Creates a new Location object.
|
||||
For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/locations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def create_async(
|
||||
self,
|
||||
params: "LocationService.CreateParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Location:
|
||||
"""
|
||||
Creates a new Location object.
|
||||
For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
||||
"""
|
||||
return cast(
|
||||
Location,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/locations",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,707 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# File generated from our OpenAPI spec
|
||||
from stripe._list_object import ListObject
|
||||
from stripe._request_options import RequestOptions
|
||||
from stripe._stripe_service import StripeService
|
||||
from stripe._util import sanitize_id
|
||||
from stripe.terminal._reader import Reader
|
||||
from typing import Dict, List, cast
|
||||
from typing_extensions import Literal, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ReaderService(StripeService):
|
||||
class CancelActionParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
|
||||
class CreateParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
label: NotRequired[str]
|
||||
"""
|
||||
Custom label given to the reader for easier identification. If no label is specified, the registration code will be used.
|
||||
"""
|
||||
location: NotRequired[str]
|
||||
"""
|
||||
The location to assign the reader to.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
registration_code: str
|
||||
"""
|
||||
A code generated by the reader used for registering to an account.
|
||||
"""
|
||||
|
||||
class DeleteParams(TypedDict):
|
||||
pass
|
||||
|
||||
class ListParams(TypedDict):
|
||||
device_type: NotRequired[
|
||||
Literal[
|
||||
"bbpos_chipper2x",
|
||||
"bbpos_wisepad3",
|
||||
"bbpos_wisepos_e",
|
||||
"mobile_phone_reader",
|
||||
"simulated_wisepos_e",
|
||||
"stripe_m2",
|
||||
"stripe_s700",
|
||||
"verifone_P400",
|
||||
]
|
||||
]
|
||||
"""
|
||||
Filters readers by device type
|
||||
"""
|
||||
ending_before: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
limit: NotRequired[int]
|
||||
"""
|
||||
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
"""
|
||||
location: NotRequired[str]
|
||||
"""
|
||||
A location ID to filter the response list to only readers at the specific location
|
||||
"""
|
||||
serial_number: NotRequired[str]
|
||||
"""
|
||||
Filters readers by serial number
|
||||
"""
|
||||
starting_after: NotRequired[str]
|
||||
"""
|
||||
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
"""
|
||||
status: NotRequired[Literal["offline", "online"]]
|
||||
"""
|
||||
A status filter to filter readers to only offline or online readers
|
||||
"""
|
||||
|
||||
class ProcessPaymentIntentParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
payment_intent: str
|
||||
"""
|
||||
PaymentIntent ID
|
||||
"""
|
||||
process_config: NotRequired[
|
||||
"ReaderService.ProcessPaymentIntentParamsProcessConfig"
|
||||
]
|
||||
"""
|
||||
Configuration overrides
|
||||
"""
|
||||
|
||||
class ProcessPaymentIntentParamsProcessConfig(TypedDict):
|
||||
enable_customer_cancellation: NotRequired[bool]
|
||||
"""
|
||||
Enables cancel button on transaction screens.
|
||||
"""
|
||||
skip_tipping: NotRequired[bool]
|
||||
"""
|
||||
Override showing a tipping selection screen on this transaction.
|
||||
"""
|
||||
tipping: NotRequired[
|
||||
"ReaderService.ProcessPaymentIntentParamsProcessConfigTipping"
|
||||
]
|
||||
"""
|
||||
Tipping configuration for this transaction.
|
||||
"""
|
||||
|
||||
class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict):
|
||||
amount_eligible: NotRequired[int]
|
||||
"""
|
||||
Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
|
||||
"""
|
||||
|
||||
class ProcessSetupIntentParams(TypedDict):
|
||||
customer_consent_collected: bool
|
||||
"""
|
||||
Customer Consent Collected
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
process_config: NotRequired[
|
||||
"ReaderService.ProcessSetupIntentParamsProcessConfig"
|
||||
]
|
||||
"""
|
||||
Configuration overrides
|
||||
"""
|
||||
setup_intent: str
|
||||
"""
|
||||
SetupIntent ID
|
||||
"""
|
||||
|
||||
class ProcessSetupIntentParamsProcessConfig(TypedDict):
|
||||
enable_customer_cancellation: NotRequired[bool]
|
||||
"""
|
||||
Enables cancel button on transaction screens.
|
||||
"""
|
||||
|
||||
class RefundPaymentParams(TypedDict):
|
||||
amount: NotRequired[int]
|
||||
"""
|
||||
A positive integer in __cents__ representing how much of this charge to refund.
|
||||
"""
|
||||
charge: NotRequired[str]
|
||||
"""
|
||||
ID of the Charge to refund.
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
metadata: NotRequired[Dict[str, str]]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
payment_intent: NotRequired[str]
|
||||
"""
|
||||
ID of the PaymentIntent to refund.
|
||||
"""
|
||||
refund_application_fee: NotRequired[bool]
|
||||
"""
|
||||
Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.
|
||||
"""
|
||||
refund_payment_config: NotRequired[
|
||||
"ReaderService.RefundPaymentParamsRefundPaymentConfig"
|
||||
]
|
||||
"""
|
||||
Configuration overrides
|
||||
"""
|
||||
reverse_transfer: NotRequired[bool]
|
||||
"""
|
||||
Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge.
|
||||
"""
|
||||
|
||||
class RefundPaymentParamsRefundPaymentConfig(TypedDict):
|
||||
enable_customer_cancellation: NotRequired[bool]
|
||||
"""
|
||||
Enables cancel button on transaction screens.
|
||||
"""
|
||||
|
||||
class RetrieveParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
|
||||
class SetReaderDisplayParams(TypedDict):
|
||||
cart: NotRequired["ReaderService.SetReaderDisplayParamsCart"]
|
||||
"""
|
||||
Cart
|
||||
"""
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
type: Literal["cart"]
|
||||
"""
|
||||
Type
|
||||
"""
|
||||
|
||||
class SetReaderDisplayParamsCart(TypedDict):
|
||||
currency: str
|
||||
"""
|
||||
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
"""
|
||||
line_items: List["ReaderService.SetReaderDisplayParamsCartLineItem"]
|
||||
"""
|
||||
Array of line items that were purchased.
|
||||
"""
|
||||
tax: NotRequired[int]
|
||||
"""
|
||||
The amount of tax in cents.
|
||||
"""
|
||||
total: int
|
||||
"""
|
||||
Total balance of cart due in cents.
|
||||
"""
|
||||
|
||||
class SetReaderDisplayParamsCartLineItem(TypedDict):
|
||||
amount: int
|
||||
"""
|
||||
The price of the item in cents.
|
||||
"""
|
||||
description: str
|
||||
"""
|
||||
The description or name of the item.
|
||||
"""
|
||||
quantity: int
|
||||
"""
|
||||
The quantity of the line item being purchased.
|
||||
"""
|
||||
|
||||
class UpdateParams(TypedDict):
|
||||
expand: NotRequired[List[str]]
|
||||
"""
|
||||
Specifies which fields in the response should be expanded.
|
||||
"""
|
||||
label: NotRequired["Literal['']|str"]
|
||||
"""
|
||||
The new label of the reader.
|
||||
"""
|
||||
metadata: NotRequired["Literal['']|Dict[str, str]"]
|
||||
"""
|
||||
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
"""
|
||||
|
||||
def delete(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Deletes a Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"delete",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def delete_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.DeleteParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Deletes a Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"delete",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def retrieve(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Retrieves a Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def retrieve_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.RetrieveParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Retrieves a Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def update_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.UpdateParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
params: "ReaderService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Reader]:
|
||||
"""
|
||||
Returns a list of Reader objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Reader],
|
||||
self._request(
|
||||
"get",
|
||||
"/v1/terminal/readers",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def list_async(
|
||||
self,
|
||||
params: "ReaderService.ListParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> ListObject[Reader]:
|
||||
"""
|
||||
Returns a list of Reader objects.
|
||||
"""
|
||||
return cast(
|
||||
ListObject[Reader],
|
||||
await self._request_async(
|
||||
"get",
|
||||
"/v1/terminal/readers",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def create(
|
||||
self,
|
||||
params: "ReaderService.CreateParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Creates a new Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def create_async(
|
||||
self,
|
||||
params: "ReaderService.CreateParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Creates a new Reader object.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers",
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def cancel_action(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.CancelActionParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Cancels the current reader action.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/cancel_action".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def cancel_action_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.CancelActionParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Cancels the current reader action.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/cancel_action".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def process_payment_intent(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.ProcessPaymentIntentParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a payment flow on a Reader.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/process_payment_intent".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def process_payment_intent_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.ProcessPaymentIntentParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a payment flow on a Reader.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/process_payment_intent".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def process_setup_intent(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.ProcessSetupIntentParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a setup intent flow on a Reader.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/process_setup_intent".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def process_setup_intent_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.ProcessSetupIntentParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a setup intent flow on a Reader.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/process_setup_intent".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def refund_payment(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.RefundPaymentParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a refund on a Reader
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/refund_payment".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def refund_payment_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.RefundPaymentParams" = {},
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Initiates a refund on a Reader
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/refund_payment".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
def set_reader_display(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.SetReaderDisplayParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Sets reader display to show cart details.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
self._request(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/set_reader_display".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
|
||||
async def set_reader_display_async(
|
||||
self,
|
||||
reader: str,
|
||||
params: "ReaderService.SetReaderDisplayParams",
|
||||
options: RequestOptions = {},
|
||||
) -> Reader:
|
||||
"""
|
||||
Sets reader display to show cart details.
|
||||
"""
|
||||
return cast(
|
||||
Reader,
|
||||
await self._request_async(
|
||||
"post",
|
||||
"/v1/terminal/readers/{reader}/set_reader_display".format(
|
||||
reader=sanitize_id(reader),
|
||||
),
|
||||
api_mode="V1",
|
||||
base_address="api",
|
||||
params=params,
|
||||
options=options,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user