Skip to content

Commit b38f8cb

Browse files
author
Okubanjo Oluwafunsho
committed
Support to export transactions
You can export all transactions, transactions between a certain period and export only settled or pending transactions
1 parent cee41c8 commit b38f8cb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/Paystack.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function createCustomer(){
361361
return $this->setGetResponse('/customer', $data)->getResponse();
362362

363363
}
364-
364+
365365
/**
366366
* Fetch a customer based on id or code
367367
* @param $customer_id
@@ -398,6 +398,24 @@ public function updateCustomer($customer_id){
398398

399399
}
400400

401+
/**
402+
* Export tranactions in .CSV
403+
* @return array
404+
*/
405+
public function exportTransactions(){
406+
407+
$data = [
408+
"from" => request()->from,
409+
"to" => request()->to,
410+
'settled' => request()->settled
411+
];
412+
413+
$this->setRequestOptions();
414+
415+
return $this->setGetResponse('/transaction/export', $data)->getResponse();
416+
417+
}
418+
401419
}
402420

403421

0 commit comments

Comments
 (0)