-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #281 from blockchyp/develop
Develop to Master
- Loading branch information
1 parent
facba61
commit aeb5939
Showing
5 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
// For composer based systems | ||
require_once('vendor/autoload.php'); | ||
|
||
// For manual installation | ||
#require_once('/path/to/blockchyp/init.php'); | ||
|
||
use BlockChyp\BlockChyp; | ||
|
||
BlockChyp::setApiKey(getenv('BC_API_KEY')); | ||
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN')); | ||
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY')); | ||
|
||
// Populate request values | ||
$request = [ | ||
'profile' => [ | ||
'dbaName' => 'DBA Name', | ||
'companyName' => 'Corporate Entity Name', | ||
], | ||
]; | ||
|
||
|
||
$response = BlockChyp::addGatewayMerchant($request); | ||
|
||
|
||
// View the result | ||
echo 'Response: ' . print_r($response, true) . PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
|
||
// Populate request values | ||
$request = [ | ||
'merchantId' => 'XXXXXXXXXXXXX', | ||
]; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
use BlockChyp\BlockChyp; | ||
|
||
require_once(__DIR__ . '/../BlockChypTestCase.php'); | ||
|
||
class AddGatewayMerchantTest extends BlockChypTestCase | ||
{ | ||
|
||
/** | ||
* @group itest | ||
*/ | ||
public function testAddGatewayMerchant() | ||
{ | ||
$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 AddGatewayMerchantTest...' . PHP_EOL; | ||
$profile = $config->profiles->partner; | ||
if (!empty($profile)) { | ||
BlockChyp::setApiKey($profile->apiKey); | ||
BlockChyp::setBearerToken($profile->bearerToken); | ||
BlockChyp::setSigningKey($profile->signingKey); | ||
} | ||
// Set request values | ||
$request = [ | ||
'profile' => [ | ||
'dbaName' => 'DBA Name', | ||
'companyName' => 'Corporate Entity Name', | ||
], | ||
]; | ||
|
||
// self::logRequest($request); | ||
|
||
try { | ||
|
||
$response = BlockChyp::addGatewayMerchant($request); | ||
|
||
// self::logResponse($response); | ||
|
||
// Response assertions | ||
|
||
$this->assertTrue($response['success']); | ||
|
||
} catch (Exception $ex) { | ||
|
||
echo $ex->getTraceAsString(); | ||
$this->assertEmpty($ex); | ||
|
||
} | ||
$this->processResponseDelay($request); | ||
} | ||
} |