| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._createable_api_resource import CreateableAPIResource |
| 4 |
from stripe._stripe_object import StripeObject |
| 5 |
from typing import ClassVar, Optional, cast |
| 6 |
from typing_extensions import Literal, Unpack, TYPE_CHECKING |
| 7 |
|
| 8 |
if TYPE_CHECKING: |
| 9 |
from stripe.params.terminal._onboarding_link_create_params import ( |
| 10 |
OnboardingLinkCreateParams, |
| 11 |
) |
| 12 |
|
| 13 |
|
| 14 |
class OnboardingLink(CreateableAPIResource["OnboardingLink"]): |
| 15 |
""" |
| 16 |
Returns redirect links used for onboarding onto Tap to Pay on iPhone. |
| 17 |
""" |
| 18 |
|
| 19 |
OBJECT_NAME: ClassVar[Literal["terminal.onboarding_link"]] = ( |
| 20 |
"terminal.onboarding_link" |
| 21 |
) |
| 22 |
|
| 23 |
class LinkOptions(StripeObject): |
| 24 |
class AppleTermsAndConditions(StripeObject): |
| 25 |
allow_relinking: Optional[bool] |
| 26 |
""" |
| 27 |
Whether the link should also support users relinking their Apple account. |
| 28 |
""" |
| 29 |
merchant_display_name: str |
| 30 |
""" |
| 31 |
The business name of the merchant accepting Apple's Terms and Conditions. |
| 32 |
""" |
| 33 |
|
| 34 |
apple_terms_and_conditions: Optional[AppleTermsAndConditions] |
| 35 |
""" |
| 36 |
The options associated with the Apple Terms and Conditions link type. |
| 37 |
""" |
| 38 |
_inner_class_types = { |
| 39 |
"apple_terms_and_conditions": AppleTermsAndConditions, |
| 40 |
} |
| 41 |
|
| 42 |
link_options: LinkOptions |
| 43 |
""" |
| 44 |
Link type options associated with the current onboarding link object. |
| 45 |
""" |
| 46 |
link_type: Literal["apple_terms_and_conditions"] |
| 47 |
""" |
| 48 |
The type of link being generated. |
| 49 |
""" |
| 50 |
object: Literal["terminal.onboarding_link"] |
| 51 |
on_behalf_of: Optional[str] |
| 52 |
""" |
| 53 |
Stripe account ID to generate the link for. |
| 54 |
""" |
| 55 |
redirect_url: str |
| 56 |
""" |
| 57 |
The link passed back to the user for their onboarding. |
| 58 |
""" |
| 59 |
|
| 60 |
@classmethod |
| 61 |
def create( |
| 62 |
cls, **params: Unpack["OnboardingLinkCreateParams"] |
| 63 |
) -> "OnboardingLink": |
| 64 |
""" |
| 65 |
Creates a new OnboardingLink object that contains a redirect_url used for onboarding onto Tap to Pay on iPhone. |
| 66 |
""" |
| 67 |
return cast( |
| 68 |
"OnboardingLink", |
| 69 |
cls._static_request( |
| 70 |
"post", |
| 71 |
cls.class_url(), |
| 72 |
params=params, |
| 73 |
), |
| 74 |
) |
| 75 |
|
| 76 |
@classmethod |
| 77 |
async def create_async( |
| 78 |
cls, **params: Unpack["OnboardingLinkCreateParams"] |
| 79 |
) -> "OnboardingLink": |
| 80 |
""" |
| 81 |
Creates a new OnboardingLink object that contains a redirect_url used for onboarding onto Tap to Pay on iPhone. |
| 82 |
""" |
| 83 |
return cast( |
| 84 |
"OnboardingLink", |
| 85 |
await cls._static_request_async( |
| 86 |
"post", |
| 87 |
cls.class_url(), |
| 88 |
params=params, |
| 89 |
), |
| 90 |
) |
| 91 |
|
| 92 |
_inner_class_types = {"link_options": LinkOptions} |