Debian Codegraph @

stripe/test_helpers/_customer_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._customer_cash_balance_transaction import (
10 CustomerCashBalanceTransaction,
11 )
12 from stripe._request_options import RequestOptions
13 from stripe.params.test_helpers._customer_fund_cash_balance_params import (
14 CustomerFundCashBalanceParams,
15 )
16
17
18 class CustomerService(StripeService):
19 def fund_cash_balance(
20 self,
21 customer: str,
22 params: "CustomerFundCashBalanceParams",
23 options: Optional["RequestOptions"] = None,
24 ) -> "CustomerCashBalanceTransaction":
25 """
26 Create an incoming testmode bank transfer
27 """
28 return cast(
29 "CustomerCashBalanceTransaction",
30 self._request(
31 "post",
32 "/v1/test_helpers/customers/{customer}/fund_cash_balance".format(
33 customer=sanitize_id(customer),
34 ),
35 base_address="api",
36 params=params,
37 options=options,
38 ),
39 )
40
41 async def fund_cash_balance_async(
42 self,
43 customer: str,
44 params: "CustomerFundCashBalanceParams",
45 options: Optional["RequestOptions"] = None,
46 ) -> "CustomerCashBalanceTransaction":
47 """
48 Create an incoming testmode bank transfer
49 """
50 return cast(
51 "CustomerCashBalanceTransaction",
52 await self._request_async(
53 "post",
54 "/v1/test_helpers/customers/{customer}/fund_cash_balance".format(
55 customer=sanitize_id(customer),
56 ),
57 base_address="api",
58 params=params,
59 options=options,
60 ),
61 )