Skip to content

Commit

Permalink
Add downloading daily payment reports via api
Browse files Browse the repository at this point in the history
  • Loading branch information
byofficial committed Feb 11, 2025
1 parent 7c551d2 commit 8570037
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions samples/retrieve_daily_payment_report.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

require_once('config/sample_config.php');

$request = array(
'reportDate' => date_create()->format('Y-m-d'),
'fileType' => 'xlsx'
);

$response = SampleConfig::craftgate()->fileReporting()->retrieveDailyPaymentReport($request);
file_put_contents('/tmp/report-php.xlsx', $response);
6 changes: 6 additions & 0 deletions src/Adapter/FileReportingAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ public function retrieveDailyTransactionReport(array $request)
$path = "/file-reporting/v1/transaction-reports/" . QueryBuilder::build($request);
return $this->httpGet($path, array('content-type: application/octet-stream'));
}

public function retrieveDailyPaymentReport(array $request)
{
$path = "/file-reporting/v1/payment-reports/" . QueryBuilder::build($request);
return $this->httpGet($path, array('content-type: application/octet-stream'));
}
}

0 comments on commit 8570037

Please sign in to comment.