Skip to content

Commit

Permalink
updating merchant invoices api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Oct 27, 2023
1 parent 85cd2b2 commit b9b12ec
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4520,10 +4520,12 @@ echo 'Response: ' . print_r($response, true) . PHP_EOL;
* **API Credential Types:** Partner or Merchant
* **Required Role:** Partner API Access or Merchant API

The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters can filter statements to a specific date range.

The API returns a list of merchant statements and invoices. By default, all invoices are returned with the most recent
statements listed first. Optional date parameters (`startDate` and `endDate`) can be used to filter statements by date
range.

The `invoiceType` parameter can also be used to filter invoices by type. Invoices could be conventional invoices, such
as those generated when ordering terminals or gift cards, or invoices could be merchant statements.



Expand Down
49 changes: 49 additions & 0 deletions tests/itests/MerchantInvoicesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

use BlockChyp\BlockChyp;

require_once(__DIR__ . '/../BlockChypTestCase.php');

class MerchantInvoicesTest extends BlockChypTestCase
{

/**
* @group itest
*/
public function testMerchantInvoices()
{
$config = $this->loadTestConfiguration();

BlockChyp::setApiKey($config->apiKey);
BlockChyp::setBearerToken($config->bearerToken);
BlockChyp::setSigningKey($config->signingKey);
BlockChyp::setGatewayHost($config->gatewayHost);
BlockChyp::setTestGatewayHost($config->testGatewayHost);
BlockChyp::setDashboardHost($config->dashboardHost);

echo 'Running MerchantInvoicesTest...' . PHP_EOL; // Set request values
$request = [
'test' => true,
];

// self::logRequest($request);

try {

$response = BlockChyp::merchantInvoices($request);

// self::logResponse($response);

// Response assertions

$this->assertTrue($response['success']);

} catch (Exception $ex) {

echo $ex->getTraceAsString();
$this->assertEmpty($ex);

}
$this->processResponseDelay($request);
}
}
2 changes: 1 addition & 1 deletion tests/itests/PartnerStatementsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testPartnerStatements()

try {

$response = BlockChyp::merchantInvoices($request);
$response = BlockChyp::partnerStatements($request);

// self::logResponse($response);

Expand Down

0 comments on commit b9b12ec

Please sign in to comment.