Skip to content

Commit 67e11da

Browse files
Fix #127 #128 #126
1 parent 2763c66 commit 67e11da

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Paystack.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function makePaymentRequest( $data = null)
115115

116116
$quantity = intval(request()->quantity ?? 1);
117117

118-
$data = [
118+
$data = array_filter([
119119
"amount" => intval(request()->amount) * $quantity,
120120
"reference" => request()->reference,
121121
"email" => request()->email,
@@ -145,10 +145,7 @@ public function makePaymentRequest( $data = null)
145145
* ]
146146
*/
147147
'metadata' => request()->metadata
148-
];
149-
150-
// Remove the fields which were not sent (value would be null)
151-
array_filter($data);
148+
]);
152149
}
153150

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

0 commit comments

Comments
 (0)