Definition at line 12 of file TransactionServiceTest.php.
◆ dataProviderTransaction()
dataProviderTransaction |
( |
| ) |
|
Get data for tests
- Returns
- array
Definition at line 89 of file TransactionServiceTest.php.
93 'transactionId' =>
'9941997799',
94 'resultStatus' =>
'Successful.',
95 'responseStatus' =>
'voided',
◆ setUp()
Definition at line 29 of file TransactionServiceTest.php.
31 $httpClientFactoryMock = $this->getHttpClientFactoryMock();
33 $this->authorizenetMock = $this->getMockBuilder(\
Magento\Authorizenet\Model\Directpost::class)
34 ->disableOriginalConstructor()
37 $this->authorizenetMock->method(
'getConfigData')
39 [
'login',
'test login'],
40 [
'trans_key',
'test key'],
41 [
'cgi_url_td',
'https://apitest.authorize.net/xml/v1/request.api']
44 $objectManagerHelper =
new ObjectManager($this);
45 $xmlSecurity = $objectManagerHelper->getObject(\
Magento\Framework\Xml\Security::class);
46 $this->transactionService = $objectManagerHelper->getObject(
47 \
Magento\Authorizenet\Model\TransactionService::class,
49 'xmlSecurityHelper' => $xmlSecurity,
50 'httpClientFactory' => $httpClientFactoryMock
◆ testLoadVoidedTransactionDetails()
testLoadVoidedTransactionDetails |
( |
|
$transactionId, |
|
|
|
$resultStatus, |
|
|
|
$responseStatus, |
|
|
|
$responseCode |
|
) |
| |
@covers \Magento\Authorizenet\Model\TransactionService::loadTransactionDetails
- Parameters
-
$transactionId | |
$resultStatus | |
$responseStatus | |
$responseCode | |
- Returns
- void
@dataProvider dataProviderTransaction
Definition at line 65 of file TransactionServiceTest.php.
67 $document = $this->getResponseBody(
74 $this->httpClientMock->expects(static::once())
76 ->willReturn($document);
78 $result = $this->transactionService->getTransactionDetails($this->authorizenetMock, $transactionId);
80 static::assertEquals($responseCode, (
string)
$result->transaction->responseCode);
81 static::assertEquals($responseCode, (
string)
$result->transaction->responseReasonCode);
82 static::assertEquals($responseStatus, (
string)
$result->transaction->transactionStatus);
const PAYMENT_UPDATE_STATUS_CODE_SUCCESS
◆ $authorizenetMock
◆ $httpClientMock
◆ $transactionService
The documentation for this class was generated from the following file: