Skip to content

Commit

Permalink
Merge pull request #12 from alabamustapha/patch-1
Browse files Browse the repository at this point in the history
Update to allow custom_fields to metadata
  • Loading branch information
Prosper Otemuyiwa authored Dec 24, 2016
2 parents dd820df + bb68e56 commit d222619
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,21 @@ public function makePaymentRequest()
"plan" => request()->plan,
"first_name" => request()->first_name,
"last_name" => request()->last_name,
"callback_url" => request()->callback_url
"callback_url" => request()->callback_url,
/*
* to allow use of metadata on Paystack dashboard and a means to return additional data back to redirect url
* form need an input field: <input type="hidden" name="metadata" value="{{ json_encode($array) }}" >
*array must be set up as: $array = [ 'custom_fields' => [
* ['display_name' => "Cart Id", "variable_name" => "cart_id", "value" => "2"],
* ['display_name' => "Sex", "variable_name" => "sex", "value" => "female"],
* .
* .
* .
* ]
*
* ]
*/
'metadata' => request()->metadata
];

// Remove the fields which were not sent (value would be null)
Expand Down

0 comments on commit d222619

Please sign in to comment.