From bb68e56b023ddc77527994b6b8ced9ea0fa52215 Mon Sep 17 00:00:00 2001 From: Alaba Mustapha Date: Fri, 23 Dec 2016 22:04:45 +0100 Subject: [PATCH] Update to allow custom_fields to metadata A means to set additional info on Paystack dashboard and get specific return data on callback url for ease of maintence of web app database. --- src/Paystack.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Paystack.php b/src/Paystack.php index eee7604..88763e3 100644 --- a/src/Paystack.php +++ b/src/Paystack.php @@ -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: + *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)