Skip to content

Commit d222619

Browse files
author
Prosper Otemuyiwa
authored
Merge pull request unicodeveloper#12 from alabamustapha/patch-1
Update to allow custom_fields to metadata
2 parents dd820df + bb68e56 commit d222619

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Paystack.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,21 @@ public function makePaymentRequest()
113113
"plan" => request()->plan,
114114
"first_name" => request()->first_name,
115115
"last_name" => request()->last_name,
116-
"callback_url" => request()->callback_url
116+
"callback_url" => request()->callback_url,
117+
/*
118+
* to allow use of metadata on Paystack dashboard and a means to return additional data back to redirect url
119+
* form need an input field: <input type="hidden" name="metadata" value="{{ json_encode($array) }}" >
120+
*array must be set up as: $array = [ 'custom_fields' => [
121+
* ['display_name' => "Cart Id", "variable_name" => "cart_id", "value" => "2"],
122+
* ['display_name' => "Sex", "variable_name" => "sex", "value" => "female"],
123+
* .
124+
* .
125+
* .
126+
* ]
127+
*
128+
* ]
129+
*/
130+
'metadata' => request()->metadata
117131
];
118132

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

0 commit comments

Comments
 (0)