Skip to content

Commit

Permalink
GetTransactionListRequest and GetSettledBatchListRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
czigor committed Aug 31, 2018
1 parent 5e80027 commit 4695a72
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/GetSettledBatchListRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace CommerceGuys\AuthNet;

use GuzzleHttp\Client;
use CommerceGuys\AuthNet\Request\RequestInterface;

/**
* Retrieve detailed information about a specific transaction.
*
* @link https://developer.authorize.net/api/reference/index.html#transaction-reporting-get-settled-batch-list
*/
class GetSettledBatchListRequest extends BaseApiRequest
{

protected $includeStatistics;

protected $firstSettlementDate;

protected $lastSettlementDate;

public function __construct(
Configuration $configuration,
Client $client,
$includeStatistics,
$firstSettlementDate,
$lastSettlementDate
) {
parent::__construct($configuration, $client);
$this->includeStatistics = $includeStatistics;
$this->firstSettlementDate = $firstSettlementDate;
$this->lastSettlementDate = $lastSettlementDate;
}

protected function attachData(RequestInterface $request)
{
if ($this->includeStatistics) {
$request->addData('includeStatistics', $this->includeStatistics);
}
$request->addData('firstSettlementDate', $this->firstSettlementDate);
$request->addData('lastSettlementDate', $this->lastSettlementDate);
}
}
30 changes: 30 additions & 0 deletions src/GetTransactionListRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace CommerceGuys\AuthNet;

use GuzzleHttp\Client;
use CommerceGuys\AuthNet\Request\RequestInterface;

/**
* Retrieve detailed information about a specific transaction.
*
* @link https://developer.authorize.net/api/reference/index.html#transaction-reporting-get-transaction-list
*/
class GetTransactionListRequest extends BaseApiRequest
{
protected $batchId;

public function __construct(
Configuration $configuration,
Client $client,
$batchId
) {
parent::__construct($configuration, $client);
$this->batchId = $batchId;
}

protected function attachData(RequestInterface $request)
{
$request->addData('batchId', $this->batchId);
}
}

0 comments on commit 4695a72

Please sign in to comment.