Skip to content

Commit 3b0a5a9

Browse files
committed
More fields for Transaction\Initialize call
Currently, the `makePaymentRequest` function ignores four other parameters which may also be presented. This fix should avoid that.
1 parent e9df56b commit 3b0a5a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Paystack.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ public function makePaymentRequest()
104104
$data = [
105105
"amount" => intval(request()->amount),
106106
"reference" => request()->reference,
107-
"email" => request()->email
107+
"email" => request()->email,
108+
"plan" => request()->plan,
109+
"first_name" => request()->first_name,
110+
"last_name" => request()->last_name,
111+
"callback_url" => request()->callback_url
108112
];
113+
114+
// Remove the fields which were not sent (value would be null)
115+
array_filter($data);
109116

110117
$this->setHttpResponse('/transaction/initialize', 'POST', $data);
111118

0 commit comments

Comments
 (0)