-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
9b1c708
commit cd224b3
Showing
3 changed files
with
54 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use KkbEpay\Requests\AbstractRequest; | ||
|
||
class AbstractRequestTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
protected $data; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->data = include __DIR__ . '/../data.php'; | ||
} | ||
|
||
|
||
public function testCreateRequest() | ||
{ | ||
$certManager = $this->getMockBuilder(\KkbEpay\SSL\CertManager::class) | ||
->setConstructorArgs([$this->data['config']]) | ||
->getMock(); | ||
|
||
$request = $this->getMockBuilder(AbstractRequest::class) | ||
->setConstructorArgs([[], [], $certManager]) | ||
->getMockForAbstractClass() | ||
; | ||
|
||
$this->assertInstanceOf(AbstractRequest::class, $request); | ||
|
||
return $request; | ||
} | ||
} |
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,13 +1,23 @@ | ||
<?php | ||
|
||
return [ | ||
'config' => [ | ||
'MERCHANT_CERTIFICATE_ID' => "00C182B189", | ||
'MERCHANT_NAME' => "Test shop", | ||
'PRIVATE_KEY_FN' => "./test-certs/cert.prv", | ||
'PRIVATE_KEY_PASS' => "nissan", | ||
'PUBLIC_KEY_FN' => "./test-certs/kkbca.pem", | ||
'BANK_PUBLIC_KEY_FN' => "./test-certs/kkbca.pem", | ||
'MERCHANT_ID' => "92061101", | ||
], | ||
|
||
'status' => [ | ||
'request' => '<document><merchant id="92061101"><order id="001234"/></merchant><merchant_sign type="RSA" cert_id="00C182B189">KRb4oQ4z4clKiFYS64WnageGbiYvpx+WOUPTb0Tef5f3NfVZSMxKLlVb+Qk54DywIDx3ez4Ng2lpir+POiXfDg==</merchant_sign></document>', | ||
'request' => '<document><merchant id="92061101"><order id="064085"/></merchant><merchant_sign type="RSA" cert_id="00C182B189">RB8oaB0UCAHIb7oyRXS8QhmNUnHcYcS6Dgff5Zmvev87WF07bt72gRmH5Cyss3qZl9j8M1zfuq0eY6aHnumzLw==</merchant_sign></document>', | ||
|
||
'response' => '<document><bank name="Kazkommertsbank JSC"><merchant id="92061101"><order id="001234"/></merchant><merchant_sign type="RSA" cert_id="00C182B189">KRb4oQ4z4clKiFYS64WnageGbiYvpx+WOUPTb0Tef5f3NfVZSMxKLlVb+Qk54DywIDx3ez4Ng2lpir+POiXfDg==</merchant_sign><response payment="false" status="8" result="8" amount="" currencycode="" timestamp="" reference="" cardhash="" card_to="" approval_code="" msg="noaction" secure="" card_bin="null" payername="" payermail="" payerphone="" c_hash="" recur="0" OrderID="001234" SessionID="563A54B12930848855003E2C3A8E8700" intreference="" AcceptRejectCode="8"/></bank><bank_sign cert_id="00c183d690" type="RSA">owEt6TnMO1SIt07bLm24E8LXyOJHsa0N9VmDH++IGEcW3HCy2XNz2rFZhH2sN2WcQeucD69xWNVMPYXmtOpLU7tliw3+S9WZqkjdzo/3Cc6AcRh+vtAY9YtndiNYRYzogsf0dCcvh7BccAE5E9n3dgY5tYvKS1rQTMhaFeB9O3Y=</bank_sign></document>' | ||
'response' => '<document><bank name="Kazkommertsbank JSC"><merchant id="92061101"><order id="064085"/></merchant><merchant_sign type="RSA" cert_id="00C182B189">RB8oaB0UCAHIb7oyRXS8QhmNUnHcYcS6Dgff5Zmvev87WF07bt72gRmH5Cyss3qZl9j8M1zfuq0eY6aHnumzLw==</merchant_sign><response payment="true" status="0" result="0" amount="1000" currencycode="398" timestamp="2018-04-18 11:59:14.0" reference="180418115914" cardhash="440564-XX-XXXX-6150" card_to="" approval_code="115914" msg="preauth" secure="No" card_bin="null" payername="John Doe" payermail="[email protected]" payerphone="null" c_hash="13988BBF7C6649F799F36A4808490A3E" recur="0" OrderID="064085" SessionID="BAEC4CA10CE48263383EAA7552348B6C" intreference="FA20180418115914" AcceptRejectCode="0"/></bank><bank_sign cert_id="00c183d690" type="RSA">qMTKYOZYFwpl58Ogxr5gcHBjBHnNtH9Odeb9C7iI67PM5GpCIsnOF+EZDdfcPBagZPX8/34+pSDt5n9XMLk3QjlbhkphufzgXRUx0NOJkwPHAzjOIAqFbbE0Ei+DCNiyUcqVmiHPhLxbDRS7wj7+d5VWWJXCNYtoD9S0/hF5jg8=</bank_sign></document>' | ||
], | ||
|
||
'payment' => [ | ||
'response' => '<document><bank name="Kazkommertsbank JSC"><customer name="Ucaf Test Maest" mail="[email protected]" phone=""><merchant cert_id="00C182B189" name="test merch"><order order_id="0706172110" amount="1000" currency="398"><department merchant_id="92056001" amount="1000"/></order></merchant><merchant_sign type="RSA"/></customer><customer_sign type="RSA"/><results timestamp="2006-07-06 17:21:50"><payment merchant_id="92056001" amount="1000" reference="618704198173" approval_code="447753" response_code="00"/></results></bank><bank_sign cert_id="00C18327E8" type="SHA/RSA">xjJwgeLAyWssZr3/gS7TI/xaajoF3USk0B/ZfLv6SYyY/3H8tDHUiyGcV7zDO5+rINwBoTn7b9BrnO/kvQfebIhHbDlCSogz2cB6Qa2ELKAGqs8aDZDekSJ5dJrgmFT6aTfgFgnZRmadybxTMHGR6cn8ve4m0TpQuaPMQmKpxTI=</bank_sign ></document>' | ||
'response' => '<document><bank name="Kazkommertsbank JSC"><customer name="John Doe" mail="[email protected]" phone=""><merchant cert_id="00C182B189" name="Test shop"><order order_id="064085" amount="1000" currency="398"><department merchant_id="92061101" amount="1000"/></order></merchant><merchant_sign type="RSA"/></customer><customer_sign type="RSA"/><results timestamp="2018-04-18 11:59:15"><payment merchant_id="92061101" card="440564-XX-XXXX-6150" amount="1000" reference="180418115914" approval_code="115914" response_code="00" Secure="No" card_bin="" c_hash="13988BBF7C6649F799F36A4808490A3E"/></results></bank><bank_sign cert_id="00c183d690" type="SHA/RSA">EpUcI/2F2MTU6l908yXTZHdFaEHB7qd318RUzluzhW7EpWgWyB6jl++QanVnM2bvJRQzS/Ik3nifRPooUxvnm9vK5YevtC8U5/HUwHqqyMghwOxEvWJM6W2bXPbzaM2U/VQRdJeM6ppaeOk10aKDxUBOLFBc7IX5ox6WhN78XUI=</bank_sign></document>' | ||
], | ||
]; |