Skip to content

Commit e47e424

Browse files
committed
add documentation to readme
1 parent bb95987 commit e47e424

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,23 @@ paystack()->updateSubAccount();
344344

345345
A sample form will look like so:
346346

347+
```php
348+
<?php
349+
// more details https://paystack.com/docs/payments/multi-split-payments/#dynamic-splits
350+
351+
$split = [
352+
"type" => "percentage",
353+
"currency" => "KES",
354+
"subaccounts" => [
355+
[ "subaccount" => "ACCT_li4p6kte2dolodo", "share" => 10 ],
356+
[ "subaccount" => "ACCT_li4p6kte2dolodo", "share" => 30 ],
357+
],
358+
"bearer_type" => "all",
359+
"main_account_share" => 70
360+
];
361+
?>
362+
```
363+
347364
```html
348365
<form method="POST" action="{{ route('pay') }}" accept-charset="UTF-8" class="form-horizontal" role="form">
349366
<div class="row" style="margin-bottom:40px;">
@@ -361,6 +378,9 @@ A sample form will look like so:
361378
<input type="hidden" name="currency" value="NGN">
362379
<input type="hidden" name="metadata" value="{{ json_encode($array = ['key_name' => 'value',]) }}" > {{-- For other necessary things you want to add to your payload. it is optional though --}}
363380
<input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> {{-- required --}}
381+
382+
<input type="hidden" name="split_code" value="SPL_EgunGUnBeCareful"> {{-- to support transaction split. more details https://paystack.com/docs/payments/multi-split-payments/#using-transaction-splits-with-payments --}}
383+
<input type="hidden" name="split" value="{{ json_encode($split) }}"> {{-- to support dynamic transaction split. More details https://paystack.com/docs/payments/multi-split-payments/#dynamic-splits --}}
364384
{{ csrf_field() }} {{-- works only when using laravel 5.1, 5.2 --}}
365385

366386
<input type="hidden" name="_token" value="{{ csrf_token() }}"> {{-- employ this in place of csrf_field only in laravel 5.0 --}}

src/Paystack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function makePaymentRequest( $data = null)
152152
* { "subaccount" => "ACCT_li4p6kte2dolodo", "share" => 30 },
153153
* ],
154154
* "bearer_type" => "all",
155-
* "main_account_share": 70,
155+
* "main_account_share" => 70,
156156
* ]
157157
* More details here: https://paystack.com/docs/payments/multi-split-payments/#dynamic-splits
158158
*/

0 commit comments

Comments
 (0)