-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
1,192 additions
and
176 deletions.
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.24.1 | ||
1.24.2 |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
[Genesis] | ||
# Setup | ||
environment = sandbox | ||
endpoint = ENTER_YOUR_ENDPOINT | ||
environment = sandbox | ||
endpoint = ENTER_YOUR_ENDPOINT | ||
|
||
# Credentials | ||
username = ENTER_YOUR_USERNAME | ||
password = ENTER_YOUR_PASSWORD | ||
username = ENTER_YOUR_USERNAME | ||
password = ENTER_YOUR_PASSWORD | ||
# Optional for WPF requests | ||
token = ENTER_YOUR_TOKEN | ||
token = ENTER_YOUR_TOKEN | ||
# Smart Router endpoint for Financial Transactions | ||
# Doesn't require token | ||
force_smart_routing = off | ||
|
||
[Interfaces] | ||
# Options: | ||
# - xml | ||
# - json | ||
builder = xml | ||
builder = xml | ||
# Options: | ||
# - curl | ||
# - stream | ||
network = curl | ||
network = curl |
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,93 @@ | ||
<?php | ||
|
||
namespace spec\Genesis\API\Request\Base; | ||
|
||
use Genesis\API\Constants\Endpoints; | ||
use Genesis\API\Constants\Environments; | ||
use Genesis\Config; | ||
use spec\Genesis\API\Stubs\Base\Request\FinancialStub; | ||
use spec\SharedExamples\Faker; | ||
|
||
class FinancialSpec extends \PhpSpec\ObjectBehavior | ||
{ | ||
private $faker_uuid; | ||
|
||
private $faker_usage; | ||
|
||
private $faker_remote_ip; | ||
|
||
public function __construct() | ||
{ | ||
$this->faker_uuid = Faker::getInstance()->uuid; | ||
$this->faker_usage = Faker::getInstance()->sentence; | ||
$this->faker_remote_ip = Faker::getInstance()->ipv4; | ||
} | ||
|
||
public function let() | ||
{ | ||
$this->beAnInstanceOf(FinancialStub::class); | ||
} | ||
|
||
public function it_when_use_smart_routing_with_getter() | ||
{ | ||
$this->getUseSmartRouter()->shouldBe(false); | ||
} | ||
|
||
public function it_should_not_throw_when_use_smart_routing_with_setter() | ||
{ | ||
$this->shouldNotThrow()->during('setUseSmartRouter', [true]); | ||
} | ||
|
||
public function it_when_use_smart_routing_with_proper_return_value() | ||
{ | ||
$this->setUseSmartRouter(true)->shouldBe($this); | ||
} | ||
|
||
public function it_when_use_smart_routing_with_proper_setter() | ||
{ | ||
$this->setUseSmartRouter('on'); | ||
|
||
$this->getUseSmartRouter()->shouldBe(true); | ||
} | ||
|
||
public function it_should_init_proper_xml_configuration_without_smart_router() | ||
{ | ||
Config::setToken($this->faker_uuid); | ||
Config::setEndpoint(Endpoints::EMERCHANTPAY); | ||
|
||
$this->getDocument(); | ||
|
||
$this->getApiConfig('url')->shouldBe( | ||
"https://staging.gate.emerchantpay.net:443/process/{$this->faker_uuid}/" | ||
); | ||
} | ||
|
||
public function it_should_init_proper_xml_configuration_with_smart_router() | ||
{ | ||
Config::setToken(Faker::getInstance()->uuid); | ||
Config::setEndpoint(Endpoints::EMERCHANTPAY); | ||
$this->setUseSmartRouter(true); | ||
|
||
$this->getDocument(); | ||
|
||
$this->getApiConfig('url')->shouldBe("https://staging.api.emerchantpay.net:443/transactions"); | ||
} | ||
|
||
public function it_should_populate_proper_base_financial_structure() | ||
{ | ||
$this->setTransactionId($this->faker_uuid); | ||
$this->setUsage($this->faker_usage); | ||
$this->setRemoteIp($this->faker_remote_ip); | ||
|
||
$this->getDocument()->shouldContain('<payment_transaction>'); | ||
$this->getDocument()->shouldContain('<transaction_type>transaction_type</transaction_type>'); | ||
$this->getDocument()->shouldContain("<transaction_id>{$this->faker_uuid}</transaction_id>"); | ||
$this->getDocument()->shouldContain("<usage>{$this->faker_usage}</usage>"); | ||
$this->getDocument()->shouldContain("<remote_ip>{$this->faker_remote_ip}</remote_ip>"); | ||
} | ||
|
||
public function it_should_populate_proper_transaction_structure() | ||
{ | ||
$this->getDocument()->shouldContain('<stub>financial</stub>'); | ||
} | ||
} |
Oops, something went wrong.