Skip to content

Commit 5edb6ea

Browse files
Merge pull request #89 from PaystackOSS/feat/update-mpesa-transfers
Feat/update mpesa transfers
2 parents 851fa4b + 1be72dd commit 5edb6ea

File tree

17 files changed

+90
-76
lines changed

17 files changed

+90
-76
lines changed

dist/api/charges/create/requests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ data='{
1515
]
1616
},
1717
"bank": {
18-
code: "057",
19-
account_number: "0000000000"
18+
"code": "057",
19+
"account_number": "0000000000"
2020
},
2121
"birthday": "1995-12-23"
2222
}'

dist/api/customers/create/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ url="https://api.paystack.co/customer"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"email": "zero@sum.com",
6+
"email": "customer@example.com",
77
"first_name": "Zero",
88
"last_name": "Sum",
99
"phone": "+2348123456789"

dist/api/plans/update/requests.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const sh = `#!/bin/sh
22
url="https://api.paystack.co/plan/:id_or_code"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
5-
data='{ "name": "Monthly retainer (renamed)" }'
5+
data='{
6+
"name": "Monthly retainer (renamed)"
7+
}'
68
79
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X PUT`
810

dist/api/products/create/requests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const sh = `#!/bin/sh
22
url="https://api.paystack.co/product"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
5-
data='{ "name": "Puff Puff",
5+
data='{
6+
"name": "Puff Puff",
67
"description": "Crispy flour ball with fluffy interior",
78
"price": "5000",
89
"currency": "NGN",

dist/api/terminal/update/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ url="https://api.paystack.co/terminal/{terminal_id}"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"address": "Somewhere on earth
6+
"address": "Somewhere on earth"
77
}'
88
99
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X PUT`

dist/api/transfers/initiate/requests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ content_type="Content-Type: application/json"
55
data='{
66
"source": "balance",
77
"reason": "Calm down",
8-
"amount":3794800, "recipient": "RCP_gx2wn530m0i3w3m"
8+
"amount":3794800,
9+
"recipient": "RCP_gx2wn530m0i3w3m"
910
}'
1011
1112
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`

dist/doc/transfers/single/transfer-recipient-mpesa.js

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ const sh = `#!/bin/sh
22
curl https://api.paystack.co/transferrecipient
33
-H "Authorization: Bearer YOUR_SECRET_KEY"
44
-H "Content-Type: application/json"
5-
-d '{ "type": "mobile_money",
6-
"name": "Andrew Jones",
7-
"account_number": "0751234987",
8-
"bank_code": "MPESA",
5+
-d '{ "type": "mobile_money_business",
6+
"name": "Till Transfer",
7+
"bank_code": "MPTILL",
8+
"account_number": "247247",
99
"currency": "KES"
1010
}'
1111
-X POST`
1212

1313
const js = `const https = require('https')
1414
1515
const params = JSON.stringify({
16-
"type":"mobile_money",
17-
"name" : "Andrew Jones",
18-
"account_number": "0751234987",
19-
"bank_code": "MPESA",
16+
"type": "mobile_money_business",
17+
"name": "Till Transfer",
18+
"bank_code": "MPTILL",
19+
"account_number": "247247",
2020
"currency": "KES"
2121
})
2222
@@ -52,11 +52,11 @@ const php = `<?php
5252
$url = "https://api.paystack.co/transferrecipient";
5353
5454
$fields = [
55-
'type' => "mobile_money",
56-
'name' => "Andrew Jones",
57-
'account_number' => "0751234987",
58-
'bank_code' => "MPESA",
59-
'currency' => "KES"
55+
"type" => "mobile_money_business",
56+
"name" => "Till Transfer",
57+
"bank_code" => "MPTILL",
58+
"account_number" => "247247",
59+
"currency" => "KES"
6060
];
6161
6262
$fields_string = http_build_query($fields);
@@ -86,24 +86,27 @@ const json = `{
8686
"message": "Transfer recipient created successfully",
8787
"data": {
8888
"active": true,
89-
"createdAt": "2023-07-04T09:24:41.473Z",
90-
"currency": "KES",
91-
"domain": "test",
92-
"id": 56462048,
93-
"integration": 845995,
94-
"name": "Andrew Jones",
95-
"recipient_code": "RCP_7awxjfhopevkpxm",
96-
"type": "mobile_money",
97-
"updatedAt": "2023-07-04T09:24:41.473Z",
98-
"is_deleted": false,
99-
"isDeleted": false,
100-
"details": {
101-
"authorization_code": null,
102-
"account_number": "0751234987",
103-
"account_name": null,
104-
"bank_code": "MPESA",
105-
"bank_name": "M-PESA"
106-
}
89+
"createdAt": "2024-11-28T09:28:50.000Z",
90+
"currency": "KES",
91+
"description": null,
92+
"domain": "test",
93+
"email": null,
94+
"id": 92176030,
95+
"integration": 845995,
96+
"metadata": null,
97+
"name": "Till Transfer Example",
98+
"recipient_code": "RCP_5vl8b2yma7xdnjp",
99+
"type": "mobile_money_business",
100+
"updatedAt": "2024-11-28T09:28:50.000Z",
101+
"is_deleted": false,
102+
"isDeleted": false,
103+
"details": {
104+
"authorization_code": null,
105+
"account_number": "247247",
106+
"account_name": null,
107+
"bank_code": "MPTILL",
108+
"bank_name": "M-PESA Till"
109+
}
107110
}
108111
}
109112
`

src/api/charges/create/index.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ data='{
1515
]
1616
},
1717
"bank": {
18-
code: "057",
19-
account_number: "0000000000"
18+
"code": "057",
19+
"account_number": "0000000000"
2020
},
2121
"birthday": "1995-12-23"
2222
}'

src/api/customers/create/index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ url="https://api.paystack.co/customer"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"email": "zero@sum.com",
6+
"email": "customer@example.com",
77
"first_name": "Zero",
88
"last_name": "Sum",
99
"phone": "+2348123456789"

src/api/plans/update/index.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
url="https://api.paystack.co/plan/:id_or_code"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
5-
data='{ "name": "Monthly retainer (renamed)" }'
5+
data='{
6+
"name": "Monthly retainer (renamed)"
7+
}'
68

79
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X PUT

src/api/products/create/index.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
url="https://api.paystack.co/product"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
5-
data='{ "name": "Puff Puff",
5+
data='{
6+
"name": "Puff Puff",
67
"description": "Crispy flour ball with fluffy interior",
78
"price": "5000",
89
"currency": "NGN",

src/api/terminal/update/index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ url="https://api.paystack.co/terminal/{terminal_id}"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"address": "Somewhere on earth
6+
"address": "Somewhere on earth"
77
}'
88

99
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X PUT

src/api/transfers/initiate/index.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ content_type="Content-Type: application/json"
55
data='{
66
"source": "balance",
77
"reason": "Calm down",
8-
"amount":3794800, "recipient": "RCP_gx2wn530m0i3w3m"
8+
"amount":3794800,
9+
"recipient": "RCP_gx2wn530m0i3w3m"
910
}'
1011

1112
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST

src/doc/transfers/single/transfer-recipient-mpesa/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const https = require('https')
22

33
const params = JSON.stringify({
4-
"type":"mobile_money",
5-
"name" : "Andrew Jones",
6-
"account_number": "0751234987",
7-
"bank_code": "MPESA",
4+
"type": "mobile_money_business",
5+
"name": "Till Transfer",
6+
"bank_code": "MPTILL",
7+
"account_number": "247247",
88
"currency": "KES"
99
})
1010

src/doc/transfers/single/transfer-recipient-mpesa/index.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
"message": "Transfer recipient created successfully",
44
"data": {
55
"active": true,
6-
"createdAt": "2023-07-04T09:24:41.473Z",
7-
"currency": "KES",
8-
"domain": "test",
9-
"id": 56462048,
10-
"integration": 845995,
11-
"name": "Andrew Jones",
12-
"recipient_code": "RCP_7awxjfhopevkpxm",
13-
"type": "mobile_money",
14-
"updatedAt": "2023-07-04T09:24:41.473Z",
15-
"is_deleted": false,
16-
"isDeleted": false,
17-
"details": {
18-
"authorization_code": null,
19-
"account_number": "0751234987",
20-
"account_name": null,
21-
"bank_code": "MPESA",
22-
"bank_name": "M-PESA"
23-
}
6+
"createdAt": "2024-11-28T09:28:50.000Z",
7+
"currency": "KES",
8+
"description": null,
9+
"domain": "test",
10+
"email": null,
11+
"id": 92176030,
12+
"integration": 845995,
13+
"metadata": null,
14+
"name": "Till Transfer Example",
15+
"recipient_code": "RCP_5vl8b2yma7xdnjp",
16+
"type": "mobile_money_business",
17+
"updatedAt": "2024-11-28T09:28:50.000Z",
18+
"is_deleted": false,
19+
"isDeleted": false,
20+
"details": {
21+
"authorization_code": null,
22+
"account_number": "247247",
23+
"account_name": null,
24+
"bank_code": "MPTILL",
25+
"bank_name": "M-PESA Till"
26+
}
2427
}
2528
}

src/doc/transfers/single/transfer-recipient-mpesa/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
$url = "https://api.paystack.co/transferrecipient";
33

44
$fields = [
5-
'type' => "mobile_money",
6-
'name' => "Andrew Jones",
7-
'account_number' => "0751234987",
8-
'bank_code' => "MPESA",
9-
'currency' => "KES"
5+
"type" => "mobile_money_business",
6+
"name" => "Till Transfer",
7+
"bank_code" => "MPTILL",
8+
"account_number" => "247247",
9+
"currency" => "KES"
1010
];
1111

1212
$fields_string = http_build_query($fields);

src/doc/transfers/single/transfer-recipient-mpesa/index.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
curl https://api.paystack.co/transferrecipient
33
-H "Authorization: Bearer YOUR_SECRET_KEY"
44
-H "Content-Type: application/json"
5-
-d '{ "type": "mobile_money",
6-
"name": "Andrew Jones",
7-
"account_number": "0751234987",
8-
"bank_code": "MPESA",
5+
-d '{ "type": "mobile_money_business",
6+
"name": "Till Transfer",
7+
"bank_code": "MPTILL",
8+
"account_number": "247247",
99
"currency": "KES"
1010
}'
1111
-X POST

0 commit comments

Comments
 (0)