Debian Codegraph @

stripe/test_helpers/_refund_service.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._stripe_service import StripeService
4 from stripe._util import sanitize_id
5 from typing import Optional, cast
6 from typing_extensions import TYPE_CHECKING
7
8 if TYPE_CHECKING:
9 from stripe._refund import Refund
10 from stripe._request_options import RequestOptions
11 from stripe.params.test_helpers._refund_expire_params import (
12 RefundExpireParams,
13 )
14
15
16 class RefundService(StripeService):
17 def expire(
18 self,
19 refund: str,
20 params: Optional["RefundExpireParams"] = None,
21 options: Optional["RequestOptions"] = None,
22 ) -> "Refund":
23 """
24 Expire a refund with a status of requires_action.
25 """
26 return cast(
27 "Refund",
28 self._request(
29 "post",
30 "/v1/test_helpers/refunds/{refund}/expire".format(
31 refund=sanitize_id(refund),
32 ),
33 base_address="api",
34 params=params,
35 options=options,
36 ),
37 )
38
39 async def expire_async(
40 self,
41 refund: str,
42 params: Optional["RefundExpireParams"] = None,
43 options: Optional["RequestOptions"] = None,
44 ) -> "Refund":
45 """
46 Expire a refund with a status of requires_action.
47 """
48 return cast(
49 "Refund",
50 await self._request_async(
51 "post",
52 "/v1/test_helpers/refunds/{refund}/expire".format(
53 refund=sanitize_id(refund),
54 ),
55 base_address="api",
56 params=params,
57 options=options,
58 ),
59 )