|
2 | 2 |
|
3 | 3 | from typing import Any, Dict, Optional |
4 | 4 |
|
5 | | -from ..client_base import ClientBase, _safe_path_param |
| 5 | +from ..client_base import ClientBase |
6 | 6 |
|
7 | 7 |
|
8 | 8 | class ChargesService(ClientBase): |
9 | 9 | """Public merchant API — generated from OpenAPI allowlist.""" |
10 | 10 |
|
11 | 11 | def cancel_card_charge(self, id: str) -> Any: |
12 | | - """Annuler un encaissement carte""" |
| 12 | + """Cancel card charge""" |
13 | 13 | path = "/charge/card/{id}/cancel" |
14 | | - path = path.replace("{id}", _safe_path_param(id)) |
| 14 | + path = path.replace("{id}", str(id)) |
15 | 15 | return self._request("POST", path) |
16 | 16 |
|
17 | 17 | def create_card_charge(self, body: Optional[Dict[str, Any]] = None) -> Any: |
18 | | - """Créer un encaissement carte (client_secret)""" |
| 18 | + """Create card charge (client_secret)""" |
19 | 19 | path = "/charge/card" |
20 | 20 | return self._request("POST", path, data=body) |
21 | 21 |
|
22 | | - def create_mtn_charge(self) -> Any: |
23 | | - """Lancer un encaissement direct MTN MoMo""" |
| 22 | + def create_mtn_charge(self, body: Optional[Dict[str, Any]] = None) -> Any: |
| 23 | + """Create MTN MoMo charge""" |
24 | 24 | path = "/charge/mtn" |
25 | | - return self._request("POST", path) |
| 25 | + return self._request("POST", path, data=body) |
| 26 | + |
| 27 | + def create_switch_charge(self, body: Optional[Dict[str, Any]] = None) -> Any: |
| 28 | + """Create Switch charge (server-side card authorization)""" |
| 29 | + path = "/charge/switch" |
| 30 | + return self._request("POST", path, data=body) |
26 | 31 |
|
27 | | - def create_wave_charge(self) -> Any: |
28 | | - """Lancer un encaissement direct Wave""" |
| 32 | + def create_wave_charge(self, body: Optional[Dict[str, Any]] = None) -> Any: |
| 33 | + """Create direct Wave charge""" |
29 | 34 | path = "/charge/wave" |
30 | | - return self._request("POST", path) |
| 35 | + return self._request("POST", path, data=body) |
31 | 36 |
|
32 | 37 | def get_card_charge(self, id: str) -> Any: |
33 | | - """Obtenir un encaissement carte""" |
| 38 | + """Retrieve card charge""" |
34 | 39 | path = "/charge/card/{id}" |
35 | | - path = path.replace("{id}", _safe_path_param(id)) |
| 40 | + path = path.replace("{id}", str(id)) |
36 | 41 | return self._request("GET", path) |
37 | 42 |
|
0 commit comments