-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout_intents_management.py
More file actions
42 lines (38 loc) · 1.33 KB
/
checkout_intents_management.py
File metadata and controls
42 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from helloasso_api_wrapper.clients.generic_client import GenericClient
from helloasso_api_wrapper.models.carts import (
CheckoutIntentResponse,
InitCheckoutBody,
InitCheckoutResponse,
)
class CheckoutIntentsManagement(GenericClient):
def retrieve_a_checkout_intent(
self,
organization_slug: str,
checkout_intent_id: int,
) -> CheckoutIntentResponse:
"""
Retrieve a checkout intent, with the order if the payment has been authorized.
"""
return self.api.callAndSerialize(
f"/organizations/{organization_slug}/checkout-intents/{checkout_intent_id}",
CheckoutIntentResponse,
method="GET",
)
def init_a_checkout(
self,
organization_slug: str,
init_checkout_body: InitCheckoutBody,
) -> InitCheckoutResponse:
"""
https://www.helloasso.com/public-documents/documents_api/documentation_checkout.pdf
Note:
- the first name must not be the same as the last name
- some first names and names are not accepted, like "test"
"""
# Tested, works
return self.api.callAndSerialize(
f"/organizations/{organization_slug}/checkout-intents",
InitCheckoutResponse,
body=init_checkout_body,
method="POST",
)