Skip to content

Commit

Permalink
Chore: Update Split requests and responses
Browse files Browse the repository at this point in the history
  • Loading branch information
damilola-paystack committed Aug 26, 2024
1 parent 8333069 commit 54e1bb5
Show file tree
Hide file tree
Showing 33 changed files with 376 additions and 520 deletions.
12 changes: 6 additions & 6 deletions dist/api/transaction-splits/add-account/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ url="https://api.paystack.co/split/:id/subaccount/add"
authorization="Authorization: Bearer YOUR_SECRET_KEY"
content_type="Content-Type: application/json"
data='{
"subaccount": "ACCT_hdl8abxl8drhrl3",
"share": 40000
"subaccount": "ACCT_eg4sob4590pq9vb",
"share": 20
}'
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`

const js = `const https = require('https')
const params = JSON.stringify({
"subaccount": "ACCT_hdl8abxl8drhrl3",
"share": 40000
"subaccount": "ACCT_eg4sob4590pq9vb",
"share": 20
})
const options = {
Expand Down Expand Up @@ -48,8 +48,8 @@ const php = `<?php
$url = "https://api.paystack.co/split/:id/subaccount/add";
$fields = [
"subaccount" => "ACCT_hdl8abxl8drhrl3",
"share" => 40000
"subaccount" => "ACCT_eg4sob4590pq9vb",
"share" => 20
];
$fields_string = http_build_query($fields);
Expand Down
49 changes: 25 additions & 24 deletions dist/api/transaction-splits/add-account/response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,51 @@
"status": true,
"message": "Subaccount added",
"data": {
"id": 143,
"name": "Test Doc",
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 428626,
"integration": 463433,
"domain": "test",
"split_code": "SPL_UO2vBzEqHW",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "subaccount",
"bearer_subaccount": 40809,
"createdAt": "2020-06-30T11:52:24.000Z",
"updatedAt": "2020-06-30T11:52:24.000Z",
"bearer_type": "all-proportional",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:50:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 40809,
"subaccount_code": "ACCT_sv6roe394nkpu6j",
"business_name": "Business Name",
"description": "Business Description",
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 20,
"settlement_bank": "Business Bank",
"account_number": "1234567890"
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 30
"share": 50
},
{
"subaccount": {
"id": 40811,
"subaccount_code": "ACCT_7i76qpjh7rr6q3z",
"business_name": "Business Name",
"description": "Business Description",
"id": 803508,
"subaccount_code": "ACCT_eg4sob4590pq9vb",
"business_name": "mmhm",
"description": "mmhm",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 20,
"settlement_bank": "Business Bank",
"account_number": "0123456789"
"settlement_bank": "Zenith Bank",
"currency": "NGN",
"account_number": "0000000000"
},
"share": 30
"share": 20
}
],
"total_subaccounts": 2
Expand Down
42 changes: 12 additions & 30 deletions dist/api/transaction-splits/create/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,27 @@ url="https://api.paystack.co/split"
authorization="Authorization: Bearer YOUR_SECRET_KEY"
content_type="Content-Type: application/json"
data='{
"name":"Percentage Split",
"name":"Halfsies",
"type":"percentage",
"currency": "NGN",
"subaccounts":[{
"subaccount": "ACCT_z3x6z3nbo14xsil",
"share": 20
},
{
"subaccount": "ACCT_pwwualwty4nhq9d",
"share": 30
}],
"bearer_type":"subaccount",
"bearer_subaccount":"ACCT_hdl8abxl8drhrl3"
"subaccount": "ACCT_6uujpqtzmnufzkw",
"share": 50
}]
}'
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`

const js = `const https = require('https')
const params = JSON.stringify({
"name":"Percentage Split",
"name":"Halfsies",
"type":"percentage",
"currency": "NGN",
"subaccounts":[{
"subaccount": "ACCT_z3x6z3nbo14xsil",
"share": 20
},
{
"subaccount": "ACCT_pwwualwty4nhq9d",
"share": 30
}],
"bearer_type":"subaccount",
"bearer_subaccount":"ACCT_hdl8abxl8drhrl3"
"subaccount": "ACCT_6uujpqtzmnufzkw",
"share": 50
}]
})
const options = {
Expand Down Expand Up @@ -70,19 +58,13 @@ const php = `<?php
$url = "https://api.paystack.co/split";
$fields = [
'name' => "Percentage Split",
'name' => "Halfsies",
'type' => "percentage",
'currency' => "NGN",
'subaccounts' => [[
"subaccount" => "ACCT_z3x6z3nbo14xsil",
"share" => 20
],
[
"subaccount" => "ACCT_pwwualwty4nhq9d",
"share" => 30
]],
'bearer_type' => "subaccount",
'bearer_subaccount' => "ACCT_hdl8abxl8drhrl3"
"subaccount" => "ACCT_6uujpqtzmnufzkw",
"share" => 50
]]
];
$fields_string = http_build_query($fields);
Expand Down
50 changes: 17 additions & 33 deletions dist/api/transaction-splits/create/response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,37 @@
"status": true,
"message": "Split created",
"data": {
"id": 142,
"name": "Test Doc",
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 428626,
"integration": 463433,
"domain": "test",
"split_code": "SPL_e7jnRLtzla",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "subaccount",
"bearer_subaccount": 40809,
"createdAt": "2020-06-30T11:42:29.150Z",
"updatedAt": "2020-06-30T11:42:29.150Z",
"bearer_type": "all",
"createdAt": "2024-08-26T11:38:47.506Z",
"updatedAt": "2024-08-26T11:38:47.506Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 40809,
"subaccount_code": "ACCT_z3x6z3nbo14xsil",
"business_name": "Business Name",
"description": "Business Description",
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 20,
"settlement_bank": "Business Bank",
"account_number": "1234567890"
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 20
},
{
"subaccount": {
"id": 40809,
"subaccount_code": "ACCT_pwwualwty4nhq9d",
"business_name": "Business Name",
"description": "Business Description",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 20,
"settlement_bank": "Business Bank",
"account_number": "0123456789"
},
"share": 30
"share": 50
}
],
"total_subaccounts": 2
"total_subaccounts": 1
}
}
}
Expand Down
55 changes: 20 additions & 35 deletions dist/api/transaction-splits/fetch/response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,38 @@
"status": true,
"message": "Split retrieved",
"data": {
"id": 143,
"name": "Test Doc",
"split_code": "SPL_UO2vBzEqHW",
"integration": 428626,
"domain": "test",
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"active": 1,
"currency": "NGN",
"bearer_type": "subaccount",
"bearer_subaccount": 40809,
"created_at": "2020-06-30T11:52:24.000Z",
"updated_at": "2020-06-30T11:52:24.000Z",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:38:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 40809,
"subaccount_code": "ACCT_z3x6z3nbo14xsil",
"business_name": "Business Name",
"description": "Business Description",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 80,
"settlement_bank": "Business Bank",
"account_number": "1234567890"
},
"share": 30
},
{
"subaccount": {
"id": 40811,
"subaccount_code": "ACCT_pwwualwty4nhq9d",
"business_name": "Business Name",
"description": "Business Description",
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"percentage_charge": 80,
"settlement_bank": "Business Bank",
"account_number": "0123456789"
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 20
"share": 50
}
],
"total_subaccounts": 2
"total_subaccounts": 1
}
}
}
Expand Down
Loading

0 comments on commit 54e1bb5

Please sign in to comment.