Skip to content

Commit cb45bc1

Browse files
Merge pull request #5 from ibrahimlawal/more-fields-for-transaction-initialize
More fields for Transaction\Initialize call
2 parents e9df56b + 3b0a5a9 commit cb45bc1

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)