Skip to content

Commit b2e7e05

Browse files
committed
Merge branch 'setup_payout_update'
2 parents c4f9e2a + e8b7795 commit b2e7e05

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ kkiapay.egg-info
55
dist
66
build
77
venv
8-
.idea
8+
.idea
9+
__pycache__

kkiapay/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def refund_transaction(self, transaction_id):
5656
)
5757

5858
def setup_payout(self, algorithm: str, destination: str, destination_type: str, roof_amount: str = None,
59-
send_notification: bool = True, rate_frequency: str = DESTINATION_TYPES["1"],
59+
send_notification: bool = True, rate_frequency: str = RATE_FREQUENCIES["1"],
6060
country_code: str = "229"):
6161
options = {
6262
"destination": country_code + destination if destination_type == "1" else destination,

readme.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,57 @@ Here's the plan for what's coming:
5959
- [x] Sandbox and Live environments
6060
- [x] Verify Transaction
6161
- [x] Refund Transaction
62-
- [ ] Schedule Payout
62+
- [x] Schedule Payout
6363
- [ ] Add better errors and exceptions handling
6464
- [ ] Add tests.
6565

66+
67+
## Schedule Payout
68+
69+
### Example
70+
Below is an example of the function usage:
71+
```python
72+
# Setup Scheduled Payout using 'ROOF' algorithm
73+
schedule_payout = k.setup_payout(algorithm = '2',
74+
roof_amount = '10000',
75+
destination = '61000000',
76+
destination_type = '1',
77+
send_notification = True,
78+
country_code = '229'
79+
)
80+
81+
print(schedule_payout)
82+
#{
83+
# 'response':
84+
# {
85+
# 'merchant': '5d34445784deb700073a0281',
86+
# 'meta_data': '',
87+
# 'algorithm': 'roof',
88+
# 'rate_frequency': '',
89+
# 'roof_amount': '10000',
90+
# 'active': True,
91+
# 'send_notification': True,
92+
# 'destination_type': 'MOBILE_MONEY',
93+
# 'destination': '22961000000',
94+
# 'job_name': '',
95+
# 'account': '5d34445784deb700073a0282'
96+
# },
97+
# 'status_code': 200
98+
#}
99+
```
100+
101+
### Attribute Matrix
102+
| Name | Required | Possible Values | Description |
103+
|:-----------------:|:--------:|:------------------------------------------:|:---------------------------------------------------------------------------------:|
104+
| **algorithm** | **M** | {"1": 'rate', "2": 'roof'} | Specify the algorithm to be used. |
105+
| **destination_type** | **M** | {"1": 'MOBILE_MONEY', "2": 'BANK_ACCOUNT'} | Specify the Destination type |
106+
| **destination** | **M** | '61000000' | Specify the Destination number/account Number |
107+
| **rate_frequency** | M/O | {"1": '3d', "2": '1w', "3": '1m'} | Specify the Rate Frequency. Required in case 'rate' algorithm is used |
108+
| **roof_amount** | M/O | '10000' | Specify the Roof amount. |
109+
| **send_notification** | O | Boolean (True, False) | Specify is a Notification should be sent |
110+
| **country_code** | O | '229' | Specify the Country Code of the destination number is case 'MOBILE MONEY' is used |
111+
112+
66113
## Contributing
67114

68115
Check our [contribution guide](CONTRIBUTING.md).

0 commit comments

Comments
 (0)