Debian Codegraph @

stripe/terminal/_reader.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._createable_api_resource import CreateableAPIResource
4 from stripe._deletable_api_resource import DeletableAPIResource
5 from stripe._expandable_field import ExpandableField
6 from stripe._list_object import ListObject
7 from stripe._listable_api_resource import ListableAPIResource
8 from stripe._stripe_object import StripeObject
9 from stripe._test_helpers import APIResourceTestHelpers
10 from stripe._updateable_api_resource import UpdateableAPIResource
11 from stripe._util import class_method_variant, sanitize_id
12 from typing import ClassVar, Dict, List, Optional, cast, overload
13 from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING
14
15 if TYPE_CHECKING:
16 from stripe._charge import Charge
17 from stripe._payment_intent import PaymentIntent
18 from stripe._payment_method import PaymentMethod
19 from stripe._refund import Refund
20 from stripe._setup_intent import SetupIntent
21 from stripe.params.terminal._reader_cancel_action_params import (
22 ReaderCancelActionParams,
23 )
24 from stripe.params.terminal._reader_collect_inputs_params import (
25 ReaderCollectInputsParams,
26 )
27 from stripe.params.terminal._reader_collect_payment_method_params import (
28 ReaderCollectPaymentMethodParams,
29 )
30 from stripe.params.terminal._reader_confirm_payment_intent_params import (
31 ReaderConfirmPaymentIntentParams,
32 )
33 from stripe.params.terminal._reader_create_params import ReaderCreateParams
34 from stripe.params.terminal._reader_delete_params import ReaderDeleteParams
35 from stripe.params.terminal._reader_list_params import ReaderListParams
36 from stripe.params.terminal._reader_modify_params import ReaderModifyParams
37 from stripe.params.terminal._reader_present_payment_method_params import (
38 ReaderPresentPaymentMethodParams,
39 )
40 from stripe.params.terminal._reader_process_payment_intent_params import (
41 ReaderProcessPaymentIntentParams,
42 )
43 from stripe.params.terminal._reader_process_setup_intent_params import (
44 ReaderProcessSetupIntentParams,
45 )
46 from stripe.params.terminal._reader_refund_payment_params import (
47 ReaderRefundPaymentParams,
48 )
49 from stripe.params.terminal._reader_retrieve_params import (
50 ReaderRetrieveParams,
51 )
52 from stripe.params.terminal._reader_set_reader_display_params import (
53 ReaderSetReaderDisplayParams,
54 )
55 from stripe.params.terminal._reader_succeed_input_collection_params import (
56 ReaderSucceedInputCollectionParams,
57 )
58 from stripe.params.terminal._reader_timeout_input_collection_params import (
59 ReaderTimeoutInputCollectionParams,
60 )
61 from stripe.terminal._location import Location
62
63
64 class Reader(
65 CreateableAPIResource["Reader"],
66 DeletableAPIResource["Reader"],
67 ListableAPIResource["Reader"],
68 UpdateableAPIResource["Reader"],
69 ):
70 """
71 A Reader represents a physical device for accepting payment details.
72
73 Related guide: [Connecting to a reader](https://docs.stripe.com/terminal/payments/connect-reader)
74 """
75
76 OBJECT_NAME: ClassVar[Literal["terminal.reader"]] = "terminal.reader"
77
78 class Action(StripeObject):
79 class CollectInputs(StripeObject):
80 class Input(StripeObject):
81 class CustomText(StripeObject):
82 description: Optional[str]
83 """
84 Customize the default description for this input
85 """
86 skip_button: Optional[str]
87 """
88 Customize the default label for this input's skip button
89 """
90 submit_button: Optional[str]
91 """
92 Customize the default label for this input's submit button
93 """
94 title: Optional[str]
95 """
96 Customize the default title for this input
97 """
98
99 class Email(StripeObject):
100 value: Optional[str]
101 """
102 The collected email address
103 """
104
105 class Numeric(StripeObject):
106 value: Optional[str]
107 """
108 The collected number
109 """
110
111 class Phone(StripeObject):
112 value: Optional[str]
113 """
114 The collected phone number
115 """
116
117 class Selection(StripeObject):
118 class Choice(StripeObject):
119 id: Optional[str]
120 """
121 The identifier for the selected choice. Maximum 50 characters.
122 """
123 style: Optional[Literal["primary", "secondary"]]
124 """
125 The button style for the choice. Can be `primary` or `secondary`.
126 """
127 text: str
128 """
129 The text to be selected. Maximum 30 characters.
130 """
131
132 choices: List[Choice]
133 """
134 List of possible choices to be selected
135 """
136 id: Optional[str]
137 """
138 The id of the selected choice
139 """
140 text: Optional[str]
141 """
142 The text of the selected choice
143 """
144 _inner_class_types = {"choices": Choice}
145
146 class Signature(StripeObject):
147 value: Optional[str]
148 """
149 The File ID of a collected signature image
150 """
151
152 class Text(StripeObject):
153 value: Optional[str]
154 """
155 The collected text value
156 """
157
158 class Toggle(StripeObject):
159 default_value: Optional[Literal["disabled", "enabled"]]
160 """
161 The toggle's default value. Can be `enabled` or `disabled`.
162 """
163 description: Optional[str]
164 """
165 The toggle's description text. Maximum 50 characters.
166 """
167 title: Optional[str]
168 """
169 The toggle's title text. Maximum 50 characters.
170 """
171 value: Optional[Literal["disabled", "enabled"]]
172 """
173 The toggle's collected value. Can be `enabled` or `disabled`.
174 """
175
176 custom_text: Optional[CustomText]
177 """
178 Default text of input being collected.
179 """
180 email: Optional[Email]
181 """
182 Information about a email being collected using a reader
183 """
184 numeric: Optional[Numeric]
185 """
186 Information about a number being collected using a reader
187 """
188 phone: Optional[Phone]
189 """
190 Information about a phone number being collected using a reader
191 """
192 required: Optional[bool]
193 """
194 Indicate that this input is required, disabling the skip button.
195 """
196 selection: Optional[Selection]
197 """
198 Information about a selection being collected using a reader
199 """
200 signature: Optional[Signature]
201 """
202 Information about a signature being collected using a reader
203 """
204 skipped: Optional[bool]
205 """
206 Indicate that this input was skipped by the user.
207 """
208 text: Optional[Text]
209 """
210 Information about text being collected using a reader
211 """
212 toggles: Optional[List[Toggle]]
213 """
214 List of toggles being collected. Values are present if collection is complete.
215 """
216 type: Literal[
217 "email",
218 "numeric",
219 "phone",
220 "selection",
221 "signature",
222 "text",
223 ]
224 """
225 Type of input being collected.
226 """
227 _inner_class_types = {
228 "custom_text": CustomText,
229 "email": Email,
230 "numeric": Numeric,
231 "phone": Phone,
232 "selection": Selection,
233 "signature": Signature,
234 "text": Text,
235 "toggles": Toggle,
236 }
237
238 inputs: List[Input]
239 """
240 List of inputs to be collected.
241 """
242 metadata: Optional[Dict[str, str]]
243 """
244 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
245 """
246 _inner_class_types = {"inputs": Input}
247
248 class CollectPaymentMethod(StripeObject):
249 class CollectConfig(StripeObject):
250 class Tipping(StripeObject):
251 amount_eligible: Optional[int]
252 """
253 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).
254 """
255
256 enable_customer_cancellation: Optional[bool]
257 """
258 Enable customer-initiated cancellation when processing this payment.
259 """
260 skip_tipping: Optional[bool]
261 """
262 Override showing a tipping selection screen on this transaction.
263 """
264 tipping: Optional[Tipping]
265 """
266 Represents a per-transaction tipping configuration
267 """
268 _inner_class_types = {"tipping": Tipping}
269
270 collect_config: Optional[CollectConfig]
271 """
272 Represents a per-transaction override of a reader configuration
273 """
274 payment_intent: ExpandableField["PaymentIntent"]
275 """
276 Most recent PaymentIntent processed by the reader.
277 """
278 payment_method: Optional["PaymentMethod"]
279 """
280 PaymentMethod objects represent your customer's payment instruments.
281 You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to
282 Customer objects to store instrument details for future payments.
283
284 Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
285 """
286 _inner_class_types = {"collect_config": CollectConfig}
287
288 class ConfirmPaymentIntent(StripeObject):
289 class ConfirmConfig(StripeObject):
290 return_url: Optional[str]
291 """
292 If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion.
293 """
294
295 confirm_config: Optional[ConfirmConfig]
296 """
297 Represents a per-transaction override of a reader configuration
298 """
299 payment_intent: ExpandableField["PaymentIntent"]
300 """
301 Most recent PaymentIntent processed by the reader.
302 """
303 _inner_class_types = {"confirm_config": ConfirmConfig}
304
305 class ProcessPaymentIntent(StripeObject):
306 class ProcessConfig(StripeObject):
307 class Tipping(StripeObject):
308 amount_eligible: Optional[int]
309 """
310 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).
311 """
312
313 enable_customer_cancellation: Optional[bool]
314 """
315 Enable customer-initiated cancellation when processing this payment.
316 """
317 return_url: Optional[str]
318 """
319 If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion.
320 """
321 skip_tipping: Optional[bool]
322 """
323 Override showing a tipping selection screen on this transaction.
324 """
325 tipping: Optional[Tipping]
326 """
327 Represents a per-transaction tipping configuration
328 """
329 _inner_class_types = {"tipping": Tipping}
330
331 payment_intent: ExpandableField["PaymentIntent"]
332 """
333 Most recent PaymentIntent processed by the reader.
334 """
335 process_config: Optional[ProcessConfig]
336 """
337 Represents a per-transaction override of a reader configuration
338 """
339 _inner_class_types = {"process_config": ProcessConfig}
340
341 class ProcessSetupIntent(StripeObject):
342 class ProcessConfig(StripeObject):
343 enable_customer_cancellation: Optional[bool]
344 """
345 Enable customer-initiated cancellation when processing this SetupIntent.
346 """
347
348 generated_card: Optional[str]
349 """
350 ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.
351 """
352 process_config: Optional[ProcessConfig]
353 """
354 Represents a per-setup override of a reader configuration
355 """
356 setup_intent: ExpandableField["SetupIntent"]
357 """
358 Most recent SetupIntent processed by the reader.
359 """
360 _inner_class_types = {"process_config": ProcessConfig}
361
362 class RefundPayment(StripeObject):
363 class RefundPaymentConfig(StripeObject):
364 enable_customer_cancellation: Optional[bool]
365 """
366 Enable customer-initiated cancellation when refunding this payment.
367 """
368
369 amount: Optional[int]
370 """
371 The amount being refunded.
372 """
373 charge: Optional[ExpandableField["Charge"]]
374 """
375 Charge that is being refunded.
376 """
377 metadata: Optional[Dict[str, str]]
378 """
379 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
380 """
381 payment_intent: Optional[ExpandableField["PaymentIntent"]]
382 """
383 Payment intent that is being refunded.
384 """
385 reason: Optional[
386 Literal["duplicate", "fraudulent", "requested_by_customer"]
387 ]
388 """
389 The reason for the refund.
390 """
391 refund: Optional[ExpandableField["Refund"]]
392 """
393 Unique identifier for the refund object.
394 """
395 refund_application_fee: Optional[bool]
396 """
397 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.
398 """
399 refund_payment_config: Optional[RefundPaymentConfig]
400 """
401 Represents a per-transaction override of a reader configuration
402 """
403 reverse_transfer: Optional[bool]
404 """
405 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.
406 """
407 _inner_class_types = {"refund_payment_config": RefundPaymentConfig}
408
409 class SetReaderDisplay(StripeObject):
410 class Cart(StripeObject):
411 class LineItem(StripeObject):
412 amount: int
413 """
414 The amount of the line item. A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
415 """
416 description: str
417 """
418 Description of the line item.
419 """
420 quantity: int
421 """
422 The quantity of the line item.
423 """
424
425 currency: str
426 """
427 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).
428 """
429 line_items: List[LineItem]
430 """
431 List of line items in the cart.
432 """
433 tax: Optional[int]
434 """
435 Tax amount for the entire cart. A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
436 """
437 total: int
438 """
439 Total amount for the entire cart, including tax. A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
440 """
441 _inner_class_types = {"line_items": LineItem}
442
443 cart: Optional[Cart]
444 """
445 Cart object to be displayed by the reader, including line items, amounts, and currency.
446 """
447 type: Literal["cart"]
448 """
449 Type of information to be displayed by the reader. Only `cart` is currently supported.
450 """
451 _inner_class_types = {"cart": Cart}
452
453 collect_inputs: Optional[CollectInputs]
454 """
455 Represents a reader action to collect customer inputs
456 """
457 collect_payment_method: Optional[CollectPaymentMethod]
458 """
459 Represents a reader action to collect a payment method
460 """
461 confirm_payment_intent: Optional[ConfirmPaymentIntent]
462 """
463 Represents a reader action to confirm a payment
464 """
465 failure_code: Optional[str]
466 """
467 Failure code, only set if status is `failed`.
468 """
469 failure_message: Optional[str]
470 """
471 Detailed failure message, only set if status is `failed`.
472 """
473 process_payment_intent: Optional[ProcessPaymentIntent]
474 """
475 Represents a reader action to process a payment intent
476 """
477 process_setup_intent: Optional[ProcessSetupIntent]
478 """
479 Represents a reader action to process a setup intent
480 """
481 refund_payment: Optional[RefundPayment]
482 """
483 Represents a reader action to refund a payment
484 """
485 set_reader_display: Optional[SetReaderDisplay]
486 """
487 Represents a reader action to set the reader display
488 """
489 status: Literal["failed", "in_progress", "succeeded"]
490 """
491 Status of the action performed by the reader.
492 """
493 type: Literal[
494 "collect_inputs",
495 "collect_payment_method",
496 "confirm_payment_intent",
497 "process_payment_intent",
498 "process_setup_intent",
499 "refund_payment",
500 "set_reader_display",
501 ]
502 """
503 Type of action performed by the reader.
504 """
505 _inner_class_types = {
506 "collect_inputs": CollectInputs,
507 "collect_payment_method": CollectPaymentMethod,
508 "confirm_payment_intent": ConfirmPaymentIntent,
509 "process_payment_intent": ProcessPaymentIntent,
510 "process_setup_intent": ProcessSetupIntent,
511 "refund_payment": RefundPayment,
512 "set_reader_display": SetReaderDisplay,
513 }
514
515 action: Optional[Action]
516 """
517 The most recent action performed by the reader.
518 """
519 deleted: Optional[Literal[True]]
520 """
521 Always true for a deleted object
522 """
523 device_sw_version: Optional[str]
524 """
525 The current software version of the reader.
526 """
527 device_type: Literal[
528 "bbpos_chipper2x",
529 "bbpos_wisepad3",
530 "bbpos_wisepos_e",
531 "mobile_phone_reader",
532 "simulated_stripe_s700",
533 "simulated_stripe_s710",
534 "simulated_wisepos_e",
535 "stripe_m2",
536 "stripe_s700",
537 "stripe_s710",
538 "verifone_P400",
539 ]
540 """
541 Device type of the reader.
542 """
543 id: str
544 """
545 Unique identifier for the object.
546 """
547 ip_address: Optional[str]
548 """
549 The local IP address of the reader.
550 """
551 label: str
552 """
553 Custom label given to the reader for easier identification.
554 """
555 last_seen_at: Optional[int]
556 """
557 The last time this reader reported to Stripe backend. Timestamp is measured in milliseconds since the Unix epoch. Unlike most other Stripe timestamp fields which use seconds, this field uses milliseconds.
558 """
559 livemode: bool
560 """
561 Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
562 """
563 location: Optional[ExpandableField["Location"]]
564 """
565 The location identifier of the reader.
566 """
567 metadata: Dict[str, str]
568 """
569 Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
570 """
571 object: Literal["terminal.reader"]
572 """
573 String representing the object's type. Objects of the same type share the same value.
574 """
575 serial_number: str
576 """
577 Serial number of the reader.
578 """
579 status: Optional[Literal["offline", "online"]]
580 """
581 The networking status of the reader. We do not recommend using this field in flows that may block taking payments.
582 """
583
584 @classmethod
585 def _cls_cancel_action(
586 cls, reader: str, **params: Unpack["ReaderCancelActionParams"]
587 ) -> "Reader":
588 """
589 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
590 """
591 return cast(
592 "Reader",
593 cls._static_request(
594 "post",
595 "/v1/terminal/readers/{reader}/cancel_action".format(
596 reader=sanitize_id(reader)
597 ),
598 params=params,
599 ),
600 )
601
602 @overload
603 @staticmethod
604 def cancel_action(
605 reader: str, **params: Unpack["ReaderCancelActionParams"]
606 ) -> "Reader":
607 """
608 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
609 """
610 ...
611
612 @overload
613 def cancel_action(
614 self, **params: Unpack["ReaderCancelActionParams"]
615 ) -> "Reader":
616 """
617 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
618 """
619 ...
620
621 @class_method_variant("_cls_cancel_action")
622 def cancel_action( # pyright: ignore[reportGeneralTypeIssues]
623 self, **params: Unpack["ReaderCancelActionParams"]
624 ) -> "Reader":
625 """
626 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
627 """
628 return cast(
629 "Reader",
630 self._request(
631 "post",
632 "/v1/terminal/readers/{reader}/cancel_action".format(
633 reader=sanitize_id(self.get("id"))
634 ),
635 params=params,
636 ),
637 )
638
639 @classmethod
640 async def _cls_cancel_action_async(
641 cls, reader: str, **params: Unpack["ReaderCancelActionParams"]
642 ) -> "Reader":
643 """
644 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
645 """
646 return cast(
647 "Reader",
648 await cls._static_request_async(
649 "post",
650 "/v1/terminal/readers/{reader}/cancel_action".format(
651 reader=sanitize_id(reader)
652 ),
653 params=params,
654 ),
655 )
656
657 @overload
658 @staticmethod
659 async def cancel_action_async(
660 reader: str, **params: Unpack["ReaderCancelActionParams"]
661 ) -> "Reader":
662 """
663 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
664 """
665 ...
666
667 @overload
668 async def cancel_action_async(
669 self, **params: Unpack["ReaderCancelActionParams"]
670 ) -> "Reader":
671 """
672 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
673 """
674 ...
675
676 @class_method_variant("_cls_cancel_action_async")
677 async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues]
678 self, **params: Unpack["ReaderCancelActionParams"]
679 ) -> "Reader":
680 """
681 Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
682 """
683 return cast(
684 "Reader",
685 await self._request_async(
686 "post",
687 "/v1/terminal/readers/{reader}/cancel_action".format(
688 reader=sanitize_id(self.get("id"))
689 ),
690 params=params,
691 ),
692 )
693
694 @classmethod
695 def _cls_collect_inputs(
696 cls, reader: str, **params: Unpack["ReaderCollectInputsParams"]
697 ) -> "Reader":
698 """
699 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
700 """
701 return cast(
702 "Reader",
703 cls._static_request(
704 "post",
705 "/v1/terminal/readers/{reader}/collect_inputs".format(
706 reader=sanitize_id(reader)
707 ),
708 params=params,
709 ),
710 )
711
712 @overload
713 @staticmethod
714 def collect_inputs(
715 reader: str, **params: Unpack["ReaderCollectInputsParams"]
716 ) -> "Reader":
717 """
718 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
719 """
720 ...
721
722 @overload
723 def collect_inputs(
724 self, **params: Unpack["ReaderCollectInputsParams"]
725 ) -> "Reader":
726 """
727 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
728 """
729 ...
730
731 @class_method_variant("_cls_collect_inputs")
732 def collect_inputs( # pyright: ignore[reportGeneralTypeIssues]
733 self, **params: Unpack["ReaderCollectInputsParams"]
734 ) -> "Reader":
735 """
736 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
737 """
738 return cast(
739 "Reader",
740 self._request(
741 "post",
742 "/v1/terminal/readers/{reader}/collect_inputs".format(
743 reader=sanitize_id(self.get("id"))
744 ),
745 params=params,
746 ),
747 )
748
749 @classmethod
750 async def _cls_collect_inputs_async(
751 cls, reader: str, **params: Unpack["ReaderCollectInputsParams"]
752 ) -> "Reader":
753 """
754 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
755 """
756 return cast(
757 "Reader",
758 await cls._static_request_async(
759 "post",
760 "/v1/terminal/readers/{reader}/collect_inputs".format(
761 reader=sanitize_id(reader)
762 ),
763 params=params,
764 ),
765 )
766
767 @overload
768 @staticmethod
769 async def collect_inputs_async(
770 reader: str, **params: Unpack["ReaderCollectInputsParams"]
771 ) -> "Reader":
772 """
773 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
774 """
775 ...
776
777 @overload
778 async def collect_inputs_async(
779 self, **params: Unpack["ReaderCollectInputsParams"]
780 ) -> "Reader":
781 """
782 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
783 """
784 ...
785
786 @class_method_variant("_cls_collect_inputs_async")
787 async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues]
788 self, **params: Unpack["ReaderCollectInputsParams"]
789 ) -> "Reader":
790 """
791 Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
792 """
793 return cast(
794 "Reader",
795 await self._request_async(
796 "post",
797 "/v1/terminal/readers/{reader}/collect_inputs".format(
798 reader=sanitize_id(self.get("id"))
799 ),
800 params=params,
801 ),
802 )
803
804 @classmethod
805 def _cls_collect_payment_method(
806 cls, reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"]
807 ) -> "Reader":
808 """
809 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
810 """
811 return cast(
812 "Reader",
813 cls._static_request(
814 "post",
815 "/v1/terminal/readers/{reader}/collect_payment_method".format(
816 reader=sanitize_id(reader)
817 ),
818 params=params,
819 ),
820 )
821
822 @overload
823 @staticmethod
824 def collect_payment_method(
825 reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"]
826 ) -> "Reader":
827 """
828 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
829 """
830 ...
831
832 @overload
833 def collect_payment_method(
834 self, **params: Unpack["ReaderCollectPaymentMethodParams"]
835 ) -> "Reader":
836 """
837 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
838 """
839 ...
840
841 @class_method_variant("_cls_collect_payment_method")
842 def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues]
843 self, **params: Unpack["ReaderCollectPaymentMethodParams"]
844 ) -> "Reader":
845 """
846 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
847 """
848 return cast(
849 "Reader",
850 self._request(
851 "post",
852 "/v1/terminal/readers/{reader}/collect_payment_method".format(
853 reader=sanitize_id(self.get("id"))
854 ),
855 params=params,
856 ),
857 )
858
859 @classmethod
860 async def _cls_collect_payment_method_async(
861 cls, reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"]
862 ) -> "Reader":
863 """
864 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
865 """
866 return cast(
867 "Reader",
868 await cls._static_request_async(
869 "post",
870 "/v1/terminal/readers/{reader}/collect_payment_method".format(
871 reader=sanitize_id(reader)
872 ),
873 params=params,
874 ),
875 )
876
877 @overload
878 @staticmethod
879 async def collect_payment_method_async(
880 reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"]
881 ) -> "Reader":
882 """
883 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
884 """
885 ...
886
887 @overload
888 async def collect_payment_method_async(
889 self, **params: Unpack["ReaderCollectPaymentMethodParams"]
890 ) -> "Reader":
891 """
892 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
893 """
894 ...
895
896 @class_method_variant("_cls_collect_payment_method_async")
897 async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssues]
898 self, **params: Unpack["ReaderCollectPaymentMethodParams"]
899 ) -> "Reader":
900 """
901 Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
902 """
903 return cast(
904 "Reader",
905 await self._request_async(
906 "post",
907 "/v1/terminal/readers/{reader}/collect_payment_method".format(
908 reader=sanitize_id(self.get("id"))
909 ),
910 params=params,
911 ),
912 )
913
914 @classmethod
915 def _cls_confirm_payment_intent(
916 cls, reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"]
917 ) -> "Reader":
918 """
919 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
920 """
921 return cast(
922 "Reader",
923 cls._static_request(
924 "post",
925 "/v1/terminal/readers/{reader}/confirm_payment_intent".format(
926 reader=sanitize_id(reader)
927 ),
928 params=params,
929 ),
930 )
931
932 @overload
933 @staticmethod
934 def confirm_payment_intent(
935 reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"]
936 ) -> "Reader":
937 """
938 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
939 """
940 ...
941
942 @overload
943 def confirm_payment_intent(
944 self, **params: Unpack["ReaderConfirmPaymentIntentParams"]
945 ) -> "Reader":
946 """
947 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
948 """
949 ...
950
951 @class_method_variant("_cls_confirm_payment_intent")
952 def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues]
953 self, **params: Unpack["ReaderConfirmPaymentIntentParams"]
954 ) -> "Reader":
955 """
956 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
957 """
958 return cast(
959 "Reader",
960 self._request(
961 "post",
962 "/v1/terminal/readers/{reader}/confirm_payment_intent".format(
963 reader=sanitize_id(self.get("id"))
964 ),
965 params=params,
966 ),
967 )
968
969 @classmethod
970 async def _cls_confirm_payment_intent_async(
971 cls, reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"]
972 ) -> "Reader":
973 """
974 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
975 """
976 return cast(
977 "Reader",
978 await cls._static_request_async(
979 "post",
980 "/v1/terminal/readers/{reader}/confirm_payment_intent".format(
981 reader=sanitize_id(reader)
982 ),
983 params=params,
984 ),
985 )
986
987 @overload
988 @staticmethod
989 async def confirm_payment_intent_async(
990 reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"]
991 ) -> "Reader":
992 """
993 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
994 """
995 ...
996
997 @overload
998 async def confirm_payment_intent_async(
999 self, **params: Unpack["ReaderConfirmPaymentIntentParams"]
1000 ) -> "Reader":
1001 """
1002 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
1003 """
1004 ...
1005
1006 @class_method_variant("_cls_confirm_payment_intent_async")
1007 async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues]
1008 self, **params: Unpack["ReaderConfirmPaymentIntentParams"]
1009 ) -> "Reader":
1010 """
1011 Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
1012 """
1013 return cast(
1014 "Reader",
1015 await self._request_async(
1016 "post",
1017 "/v1/terminal/readers/{reader}/confirm_payment_intent".format(
1018 reader=sanitize_id(self.get("id"))
1019 ),
1020 params=params,
1021 ),
1022 )
1023
1024 @classmethod
1025 def create(cls, **params: Unpack["ReaderCreateParams"]) -> "Reader":
1026 """
1027 Creates a new Reader object.
1028 """
1029 return cast(
1030 "Reader",
1031 cls._static_request(
1032 "post",
1033 cls.class_url(),
1034 params=params,
1035 ),
1036 )
1037
1038 @classmethod
1039 async def create_async(
1040 cls, **params: Unpack["ReaderCreateParams"]
1041 ) -> "Reader":
1042 """
1043 Creates a new Reader object.
1044 """
1045 return cast(
1046 "Reader",
1047 await cls._static_request_async(
1048 "post",
1049 cls.class_url(),
1050 params=params,
1051 ),
1052 )
1053
1054 @classmethod
1055 def _cls_delete(
1056 cls, sid: str, **params: Unpack["ReaderDeleteParams"]
1057 ) -> "Reader":
1058 """
1059 Deletes a Reader object.
1060 """
1061 url = "%s/%s" % (cls.class_url(), sanitize_id(sid))
1062 return cast(
1063 "Reader",
1064 cls._static_request(
1065 "delete",
1066 url,
1067 params=params,
1068 ),
1069 )
1070
1071 @overload
1072 @staticmethod
1073 def delete(sid: str, **params: Unpack["ReaderDeleteParams"]) -> "Reader":
1074 """
1075 Deletes a Reader object.
1076 """
1077 ...
1078
1079 @overload
1080 def delete(self, **params: Unpack["ReaderDeleteParams"]) -> "Reader":
1081 """
1082 Deletes a Reader object.
1083 """
1084 ...
1085
1086 @class_method_variant("_cls_delete")
1087 def delete( # pyright: ignore[reportGeneralTypeIssues]
1088 self, **params: Unpack["ReaderDeleteParams"]
1089 ) -> "Reader":
1090 """
1091 Deletes a Reader object.
1092 """
1093 return self._request_and_refresh(
1094 "delete",
1095 self.instance_url(),
1096 params=params,
1097 )
1098
1099 @classmethod
1100 async def _cls_delete_async(
1101 cls, sid: str, **params: Unpack["ReaderDeleteParams"]
1102 ) -> "Reader":
1103 """
1104 Deletes a Reader object.
1105 """
1106 url = "%s/%s" % (cls.class_url(), sanitize_id(sid))
1107 return cast(
1108 "Reader",
1109 await cls._static_request_async(
1110 "delete",
1111 url,
1112 params=params,
1113 ),
1114 )
1115
1116 @overload
1117 @staticmethod
1118 async def delete_async(
1119 sid: str, **params: Unpack["ReaderDeleteParams"]
1120 ) -> "Reader":
1121 """
1122 Deletes a Reader object.
1123 """
1124 ...
1125
1126 @overload
1127 async def delete_async(
1128 self, **params: Unpack["ReaderDeleteParams"]
1129 ) -> "Reader":
1130 """
1131 Deletes a Reader object.
1132 """
1133 ...
1134
1135 @class_method_variant("_cls_delete_async")
1136 async def delete_async( # pyright: ignore[reportGeneralTypeIssues]
1137 self, **params: Unpack["ReaderDeleteParams"]
1138 ) -> "Reader":
1139 """
1140 Deletes a Reader object.
1141 """
1142 return await self._request_and_refresh_async(
1143 "delete",
1144 self.instance_url(),
1145 params=params,
1146 )
1147
1148 @classmethod
1149 def list(
1150 cls, **params: Unpack["ReaderListParams"]
1151 ) -> ListObject["Reader"]:
1152 """
1153 Returns a list of Reader objects.
1154 """
1155 result = cls._static_request(
1156 "get",
1157 cls.class_url(),
1158 params=params,
1159 )
1160 if not isinstance(result, ListObject):
1161 raise TypeError(
1162 "Expected list object from API, got %s"
1163 % (type(result).__name__)
1164 )
1165
1166 return result
1167
1168 @classmethod
1169 async def list_async(
1170 cls, **params: Unpack["ReaderListParams"]
1171 ) -> ListObject["Reader"]:
1172 """
1173 Returns a list of Reader objects.
1174 """
1175 result = await cls._static_request_async(
1176 "get",
1177 cls.class_url(),
1178 params=params,
1179 )
1180 if not isinstance(result, ListObject):
1181 raise TypeError(
1182 "Expected list object from API, got %s"
1183 % (type(result).__name__)
1184 )
1185
1186 return result
1187
1188 @classmethod
1189 def modify(
1190 cls, id: str, **params: Unpack["ReaderModifyParams"]
1191 ) -> "Reader":
1192 """
1193 Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
1194 """
1195 url = "%s/%s" % (cls.class_url(), sanitize_id(id))
1196 return cast(
1197 "Reader",
1198 cls._static_request(
1199 "post",
1200 url,
1201 params=params,
1202 ),
1203 )
1204
1205 @classmethod
1206 async def modify_async(
1207 cls, id: str, **params: Unpack["ReaderModifyParams"]
1208 ) -> "Reader":
1209 """
1210 Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
1211 """
1212 url = "%s/%s" % (cls.class_url(), sanitize_id(id))
1213 return cast(
1214 "Reader",
1215 await cls._static_request_async(
1216 "post",
1217 url,
1218 params=params,
1219 ),
1220 )
1221
1222 @classmethod
1223 def _cls_process_payment_intent(
1224 cls, reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"]
1225 ) -> "Reader":
1226 """
1227 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1228 """
1229 return cast(
1230 "Reader",
1231 cls._static_request(
1232 "post",
1233 "/v1/terminal/readers/{reader}/process_payment_intent".format(
1234 reader=sanitize_id(reader)
1235 ),
1236 params=params,
1237 ),
1238 )
1239
1240 @overload
1241 @staticmethod
1242 def process_payment_intent(
1243 reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"]
1244 ) -> "Reader":
1245 """
1246 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1247 """
1248 ...
1249
1250 @overload
1251 def process_payment_intent(
1252 self, **params: Unpack["ReaderProcessPaymentIntentParams"]
1253 ) -> "Reader":
1254 """
1255 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1256 """
1257 ...
1258
1259 @class_method_variant("_cls_process_payment_intent")
1260 def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues]
1261 self, **params: Unpack["ReaderProcessPaymentIntentParams"]
1262 ) -> "Reader":
1263 """
1264 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1265 """
1266 return cast(
1267 "Reader",
1268 self._request(
1269 "post",
1270 "/v1/terminal/readers/{reader}/process_payment_intent".format(
1271 reader=sanitize_id(self.get("id"))
1272 ),
1273 params=params,
1274 ),
1275 )
1276
1277 @classmethod
1278 async def _cls_process_payment_intent_async(
1279 cls, reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"]
1280 ) -> "Reader":
1281 """
1282 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1283 """
1284 return cast(
1285 "Reader",
1286 await cls._static_request_async(
1287 "post",
1288 "/v1/terminal/readers/{reader}/process_payment_intent".format(
1289 reader=sanitize_id(reader)
1290 ),
1291 params=params,
1292 ),
1293 )
1294
1295 @overload
1296 @staticmethod
1297 async def process_payment_intent_async(
1298 reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"]
1299 ) -> "Reader":
1300 """
1301 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1302 """
1303 ...
1304
1305 @overload
1306 async def process_payment_intent_async(
1307 self, **params: Unpack["ReaderProcessPaymentIntentParams"]
1308 ) -> "Reader":
1309 """
1310 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1311 """
1312 ...
1313
1314 @class_method_variant("_cls_process_payment_intent_async")
1315 async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues]
1316 self, **params: Unpack["ReaderProcessPaymentIntentParams"]
1317 ) -> "Reader":
1318 """
1319 Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
1320 """
1321 return cast(
1322 "Reader",
1323 await self._request_async(
1324 "post",
1325 "/v1/terminal/readers/{reader}/process_payment_intent".format(
1326 reader=sanitize_id(self.get("id"))
1327 ),
1328 params=params,
1329 ),
1330 )
1331
1332 @classmethod
1333 def _cls_process_setup_intent(
1334 cls, reader: str, **params: Unpack["ReaderProcessSetupIntentParams"]
1335 ) -> "Reader":
1336 """
1337 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1338 """
1339 return cast(
1340 "Reader",
1341 cls._static_request(
1342 "post",
1343 "/v1/terminal/readers/{reader}/process_setup_intent".format(
1344 reader=sanitize_id(reader)
1345 ),
1346 params=params,
1347 ),
1348 )
1349
1350 @overload
1351 @staticmethod
1352 def process_setup_intent(
1353 reader: str, **params: Unpack["ReaderProcessSetupIntentParams"]
1354 ) -> "Reader":
1355 """
1356 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1357 """
1358 ...
1359
1360 @overload
1361 def process_setup_intent(
1362 self, **params: Unpack["ReaderProcessSetupIntentParams"]
1363 ) -> "Reader":
1364 """
1365 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1366 """
1367 ...
1368
1369 @class_method_variant("_cls_process_setup_intent")
1370 def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues]
1371 self, **params: Unpack["ReaderProcessSetupIntentParams"]
1372 ) -> "Reader":
1373 """
1374 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1375 """
1376 return cast(
1377 "Reader",
1378 self._request(
1379 "post",
1380 "/v1/terminal/readers/{reader}/process_setup_intent".format(
1381 reader=sanitize_id(self.get("id"))
1382 ),
1383 params=params,
1384 ),
1385 )
1386
1387 @classmethod
1388 async def _cls_process_setup_intent_async(
1389 cls, reader: str, **params: Unpack["ReaderProcessSetupIntentParams"]
1390 ) -> "Reader":
1391 """
1392 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1393 """
1394 return cast(
1395 "Reader",
1396 await cls._static_request_async(
1397 "post",
1398 "/v1/terminal/readers/{reader}/process_setup_intent".format(
1399 reader=sanitize_id(reader)
1400 ),
1401 params=params,
1402 ),
1403 )
1404
1405 @overload
1406 @staticmethod
1407 async def process_setup_intent_async(
1408 reader: str, **params: Unpack["ReaderProcessSetupIntentParams"]
1409 ) -> "Reader":
1410 """
1411 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1412 """
1413 ...
1414
1415 @overload
1416 async def process_setup_intent_async(
1417 self, **params: Unpack["ReaderProcessSetupIntentParams"]
1418 ) -> "Reader":
1419 """
1420 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1421 """
1422 ...
1423
1424 @class_method_variant("_cls_process_setup_intent_async")
1425 async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues]
1426 self, **params: Unpack["ReaderProcessSetupIntentParams"]
1427 ) -> "Reader":
1428 """
1429 Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
1430 """
1431 return cast(
1432 "Reader",
1433 await self._request_async(
1434 "post",
1435 "/v1/terminal/readers/{reader}/process_setup_intent".format(
1436 reader=sanitize_id(self.get("id"))
1437 ),
1438 params=params,
1439 ),
1440 )
1441
1442 @classmethod
1443 def _cls_refund_payment(
1444 cls, reader: str, **params: Unpack["ReaderRefundPaymentParams"]
1445 ) -> "Reader":
1446 """
1447 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1448 """
1449 return cast(
1450 "Reader",
1451 cls._static_request(
1452 "post",
1453 "/v1/terminal/readers/{reader}/refund_payment".format(
1454 reader=sanitize_id(reader)
1455 ),
1456 params=params,
1457 ),
1458 )
1459
1460 @overload
1461 @staticmethod
1462 def refund_payment(
1463 reader: str, **params: Unpack["ReaderRefundPaymentParams"]
1464 ) -> "Reader":
1465 """
1466 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1467 """
1468 ...
1469
1470 @overload
1471 def refund_payment(
1472 self, **params: Unpack["ReaderRefundPaymentParams"]
1473 ) -> "Reader":
1474 """
1475 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1476 """
1477 ...
1478
1479 @class_method_variant("_cls_refund_payment")
1480 def refund_payment( # pyright: ignore[reportGeneralTypeIssues]
1481 self, **params: Unpack["ReaderRefundPaymentParams"]
1482 ) -> "Reader":
1483 """
1484 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1485 """
1486 return cast(
1487 "Reader",
1488 self._request(
1489 "post",
1490 "/v1/terminal/readers/{reader}/refund_payment".format(
1491 reader=sanitize_id(self.get("id"))
1492 ),
1493 params=params,
1494 ),
1495 )
1496
1497 @classmethod
1498 async def _cls_refund_payment_async(
1499 cls, reader: str, **params: Unpack["ReaderRefundPaymentParams"]
1500 ) -> "Reader":
1501 """
1502 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1503 """
1504 return cast(
1505 "Reader",
1506 await cls._static_request_async(
1507 "post",
1508 "/v1/terminal/readers/{reader}/refund_payment".format(
1509 reader=sanitize_id(reader)
1510 ),
1511 params=params,
1512 ),
1513 )
1514
1515 @overload
1516 @staticmethod
1517 async def refund_payment_async(
1518 reader: str, **params: Unpack["ReaderRefundPaymentParams"]
1519 ) -> "Reader":
1520 """
1521 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1522 """
1523 ...
1524
1525 @overload
1526 async def refund_payment_async(
1527 self, **params: Unpack["ReaderRefundPaymentParams"]
1528 ) -> "Reader":
1529 """
1530 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1531 """
1532 ...
1533
1534 @class_method_variant("_cls_refund_payment_async")
1535 async def refund_payment_async( # pyright: ignore[reportGeneralTypeIssues]
1536 self, **params: Unpack["ReaderRefundPaymentParams"]
1537 ) -> "Reader":
1538 """
1539 Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
1540 """
1541 return cast(
1542 "Reader",
1543 await self._request_async(
1544 "post",
1545 "/v1/terminal/readers/{reader}/refund_payment".format(
1546 reader=sanitize_id(self.get("id"))
1547 ),
1548 params=params,
1549 ),
1550 )
1551
1552 @classmethod
1553 def retrieve(
1554 cls, id: str, **params: Unpack["ReaderRetrieveParams"]
1555 ) -> "Reader":
1556 """
1557 Retrieves a Reader object.
1558 """
1559 instance = cls(id, **params)
1560 instance.refresh()
1561 return instance
1562
1563 @classmethod
1564 async def retrieve_async(
1565 cls, id: str, **params: Unpack["ReaderRetrieveParams"]
1566 ) -> "Reader":
1567 """
1568 Retrieves a Reader object.
1569 """
1570 instance = cls(id, **params)
1571 await instance.refresh_async()
1572 return instance
1573
1574 @classmethod
1575 def _cls_set_reader_display(
1576 cls, reader: str, **params: Unpack["ReaderSetReaderDisplayParams"]
1577 ) -> "Reader":
1578 """
1579 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1580 """
1581 return cast(
1582 "Reader",
1583 cls._static_request(
1584 "post",
1585 "/v1/terminal/readers/{reader}/set_reader_display".format(
1586 reader=sanitize_id(reader)
1587 ),
1588 params=params,
1589 ),
1590 )
1591
1592 @overload
1593 @staticmethod
1594 def set_reader_display(
1595 reader: str, **params: Unpack["ReaderSetReaderDisplayParams"]
1596 ) -> "Reader":
1597 """
1598 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1599 """
1600 ...
1601
1602 @overload
1603 def set_reader_display(
1604 self, **params: Unpack["ReaderSetReaderDisplayParams"]
1605 ) -> "Reader":
1606 """
1607 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1608 """
1609 ...
1610
1611 @class_method_variant("_cls_set_reader_display")
1612 def set_reader_display( # pyright: ignore[reportGeneralTypeIssues]
1613 self, **params: Unpack["ReaderSetReaderDisplayParams"]
1614 ) -> "Reader":
1615 """
1616 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1617 """
1618 return cast(
1619 "Reader",
1620 self._request(
1621 "post",
1622 "/v1/terminal/readers/{reader}/set_reader_display".format(
1623 reader=sanitize_id(self.get("id"))
1624 ),
1625 params=params,
1626 ),
1627 )
1628
1629 @classmethod
1630 async def _cls_set_reader_display_async(
1631 cls, reader: str, **params: Unpack["ReaderSetReaderDisplayParams"]
1632 ) -> "Reader":
1633 """
1634 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1635 """
1636 return cast(
1637 "Reader",
1638 await cls._static_request_async(
1639 "post",
1640 "/v1/terminal/readers/{reader}/set_reader_display".format(
1641 reader=sanitize_id(reader)
1642 ),
1643 params=params,
1644 ),
1645 )
1646
1647 @overload
1648 @staticmethod
1649 async def set_reader_display_async(
1650 reader: str, **params: Unpack["ReaderSetReaderDisplayParams"]
1651 ) -> "Reader":
1652 """
1653 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1654 """
1655 ...
1656
1657 @overload
1658 async def set_reader_display_async(
1659 self, **params: Unpack["ReaderSetReaderDisplayParams"]
1660 ) -> "Reader":
1661 """
1662 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1663 """
1664 ...
1665
1666 @class_method_variant("_cls_set_reader_display_async")
1667 async def set_reader_display_async( # pyright: ignore[reportGeneralTypeIssues]
1668 self, **params: Unpack["ReaderSetReaderDisplayParams"]
1669 ) -> "Reader":
1670 """
1671 Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display).
1672 """
1673 return cast(
1674 "Reader",
1675 await self._request_async(
1676 "post",
1677 "/v1/terminal/readers/{reader}/set_reader_display".format(
1678 reader=sanitize_id(self.get("id"))
1679 ),
1680 params=params,
1681 ),
1682 )
1683
1684 class TestHelpers(APIResourceTestHelpers["Reader"]):
1685 _resource_cls: Type["Reader"]
1686
1687 @classmethod
1688 def _cls_present_payment_method(
1689 cls,
1690 reader: str,
1691 **params: Unpack["ReaderPresentPaymentMethodParams"],
1692 ) -> "Reader":
1693 """
1694 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1695 """
1696 return cast(
1697 "Reader",
1698 cls._static_request(
1699 "post",
1700 "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format(
1701 reader=sanitize_id(reader)
1702 ),
1703 params=params,
1704 ),
1705 )
1706
1707 @overload
1708 @staticmethod
1709 def present_payment_method(
1710 reader: str, **params: Unpack["ReaderPresentPaymentMethodParams"]
1711 ) -> "Reader":
1712 """
1713 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1714 """
1715 ...
1716
1717 @overload
1718 def present_payment_method(
1719 self, **params: Unpack["ReaderPresentPaymentMethodParams"]
1720 ) -> "Reader":
1721 """
1722 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1723 """
1724 ...
1725
1726 @class_method_variant("_cls_present_payment_method")
1727 def present_payment_method( # pyright: ignore[reportGeneralTypeIssues]
1728 self, **params: Unpack["ReaderPresentPaymentMethodParams"]
1729 ) -> "Reader":
1730 """
1731 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1732 """
1733 return cast(
1734 "Reader",
1735 self.resource._request(
1736 "post",
1737 "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format(
1738 reader=sanitize_id(self.resource.get("id"))
1739 ),
1740 params=params,
1741 ),
1742 )
1743
1744 @classmethod
1745 async def _cls_present_payment_method_async(
1746 cls,
1747 reader: str,
1748 **params: Unpack["ReaderPresentPaymentMethodParams"],
1749 ) -> "Reader":
1750 """
1751 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1752 """
1753 return cast(
1754 "Reader",
1755 await cls._static_request_async(
1756 "post",
1757 "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format(
1758 reader=sanitize_id(reader)
1759 ),
1760 params=params,
1761 ),
1762 )
1763
1764 @overload
1765 @staticmethod
1766 async def present_payment_method_async(
1767 reader: str, **params: Unpack["ReaderPresentPaymentMethodParams"]
1768 ) -> "Reader":
1769 """
1770 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1771 """
1772 ...
1773
1774 @overload
1775 async def present_payment_method_async(
1776 self, **params: Unpack["ReaderPresentPaymentMethodParams"]
1777 ) -> "Reader":
1778 """
1779 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1780 """
1781 ...
1782
1783 @class_method_variant("_cls_present_payment_method_async")
1784 async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssues]
1785 self, **params: Unpack["ReaderPresentPaymentMethodParams"]
1786 ) -> "Reader":
1787 """
1788 Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
1789 """
1790 return cast(
1791 "Reader",
1792 await self.resource._request_async(
1793 "post",
1794 "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format(
1795 reader=sanitize_id(self.resource.get("id"))
1796 ),
1797 params=params,
1798 ),
1799 )
1800
1801 @classmethod
1802 def _cls_succeed_input_collection(
1803 cls,
1804 reader: str,
1805 **params: Unpack["ReaderSucceedInputCollectionParams"],
1806 ) -> "Reader":
1807 """
1808 Use this endpoint to trigger a successful input collection on a simulated reader.
1809 """
1810 return cast(
1811 "Reader",
1812 cls._static_request(
1813 "post",
1814 "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format(
1815 reader=sanitize_id(reader)
1816 ),
1817 params=params,
1818 ),
1819 )
1820
1821 @overload
1822 @staticmethod
1823 def succeed_input_collection(
1824 reader: str, **params: Unpack["ReaderSucceedInputCollectionParams"]
1825 ) -> "Reader":
1826 """
1827 Use this endpoint to trigger a successful input collection on a simulated reader.
1828 """
1829 ...
1830
1831 @overload
1832 def succeed_input_collection(
1833 self, **params: Unpack["ReaderSucceedInputCollectionParams"]
1834 ) -> "Reader":
1835 """
1836 Use this endpoint to trigger a successful input collection on a simulated reader.
1837 """
1838 ...
1839
1840 @class_method_variant("_cls_succeed_input_collection")
1841 def succeed_input_collection( # pyright: ignore[reportGeneralTypeIssues]
1842 self, **params: Unpack["ReaderSucceedInputCollectionParams"]
1843 ) -> "Reader":
1844 """
1845 Use this endpoint to trigger a successful input collection on a simulated reader.
1846 """
1847 return cast(
1848 "Reader",
1849 self.resource._request(
1850 "post",
1851 "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format(
1852 reader=sanitize_id(self.resource.get("id"))
1853 ),
1854 params=params,
1855 ),
1856 )
1857
1858 @classmethod
1859 async def _cls_succeed_input_collection_async(
1860 cls,
1861 reader: str,
1862 **params: Unpack["ReaderSucceedInputCollectionParams"],
1863 ) -> "Reader":
1864 """
1865 Use this endpoint to trigger a successful input collection on a simulated reader.
1866 """
1867 return cast(
1868 "Reader",
1869 await cls._static_request_async(
1870 "post",
1871 "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format(
1872 reader=sanitize_id(reader)
1873 ),
1874 params=params,
1875 ),
1876 )
1877
1878 @overload
1879 @staticmethod
1880 async def succeed_input_collection_async(
1881 reader: str, **params: Unpack["ReaderSucceedInputCollectionParams"]
1882 ) -> "Reader":
1883 """
1884 Use this endpoint to trigger a successful input collection on a simulated reader.
1885 """
1886 ...
1887
1888 @overload
1889 async def succeed_input_collection_async(
1890 self, **params: Unpack["ReaderSucceedInputCollectionParams"]
1891 ) -> "Reader":
1892 """
1893 Use this endpoint to trigger a successful input collection on a simulated reader.
1894 """
1895 ...
1896
1897 @class_method_variant("_cls_succeed_input_collection_async")
1898 async def succeed_input_collection_async( # pyright: ignore[reportGeneralTypeIssues]
1899 self, **params: Unpack["ReaderSucceedInputCollectionParams"]
1900 ) -> "Reader":
1901 """
1902 Use this endpoint to trigger a successful input collection on a simulated reader.
1903 """
1904 return cast(
1905 "Reader",
1906 await self.resource._request_async(
1907 "post",
1908 "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format(
1909 reader=sanitize_id(self.resource.get("id"))
1910 ),
1911 params=params,
1912 ),
1913 )
1914
1915 @classmethod
1916 def _cls_timeout_input_collection(
1917 cls,
1918 reader: str,
1919 **params: Unpack["ReaderTimeoutInputCollectionParams"],
1920 ) -> "Reader":
1921 """
1922 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1923 """
1924 return cast(
1925 "Reader",
1926 cls._static_request(
1927 "post",
1928 "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format(
1929 reader=sanitize_id(reader)
1930 ),
1931 params=params,
1932 ),
1933 )
1934
1935 @overload
1936 @staticmethod
1937 def timeout_input_collection(
1938 reader: str, **params: Unpack["ReaderTimeoutInputCollectionParams"]
1939 ) -> "Reader":
1940 """
1941 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1942 """
1943 ...
1944
1945 @overload
1946 def timeout_input_collection(
1947 self, **params: Unpack["ReaderTimeoutInputCollectionParams"]
1948 ) -> "Reader":
1949 """
1950 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1951 """
1952 ...
1953
1954 @class_method_variant("_cls_timeout_input_collection")
1955 def timeout_input_collection( # pyright: ignore[reportGeneralTypeIssues]
1956 self, **params: Unpack["ReaderTimeoutInputCollectionParams"]
1957 ) -> "Reader":
1958 """
1959 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1960 """
1961 return cast(
1962 "Reader",
1963 self.resource._request(
1964 "post",
1965 "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format(
1966 reader=sanitize_id(self.resource.get("id"))
1967 ),
1968 params=params,
1969 ),
1970 )
1971
1972 @classmethod
1973 async def _cls_timeout_input_collection_async(
1974 cls,
1975 reader: str,
1976 **params: Unpack["ReaderTimeoutInputCollectionParams"],
1977 ) -> "Reader":
1978 """
1979 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1980 """
1981 return cast(
1982 "Reader",
1983 await cls._static_request_async(
1984 "post",
1985 "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format(
1986 reader=sanitize_id(reader)
1987 ),
1988 params=params,
1989 ),
1990 )
1991
1992 @overload
1993 @staticmethod
1994 async def timeout_input_collection_async(
1995 reader: str, **params: Unpack["ReaderTimeoutInputCollectionParams"]
1996 ) -> "Reader":
1997 """
1998 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
1999 """
2000 ...
2001
2002 @overload
2003 async def timeout_input_collection_async(
2004 self, **params: Unpack["ReaderTimeoutInputCollectionParams"]
2005 ) -> "Reader":
2006 """
2007 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
2008 """
2009 ...
2010
2011 @class_method_variant("_cls_timeout_input_collection_async")
2012 async def timeout_input_collection_async( # pyright: ignore[reportGeneralTypeIssues]
2013 self, **params: Unpack["ReaderTimeoutInputCollectionParams"]
2014 ) -> "Reader":
2015 """
2016 Use this endpoint to complete an input collection with a timeout error on a simulated reader.
2017 """
2018 return cast(
2019 "Reader",
2020 await self.resource._request_async(
2021 "post",
2022 "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format(
2023 reader=sanitize_id(self.resource.get("id"))
2024 ),
2025 params=params,
2026 ),
2027 )
2028
2029 @property
2030 def test_helpers(self):
2031 return self.TestHelpers(self)
2032
2033 _inner_class_types = {"action": Action}
2034
2035
2036 Reader.TestHelpers._resource_cls = Reader