Skip to content

Commit

Permalink
Adding new Mock files.
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptpa committed May 26, 2018
1 parent 0db2ff0 commit 658c012
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 29 deletions.
4 changes: 0 additions & 4 deletions src/Message/SecureXMLAbstractRequest.php
Expand Up @@ -73,10 +73,6 @@ public function getMessageId()
return $this->getParameter('messageId');
}

/**
* @param $data
* @return mixed
*/
public function sendData($data)
{
$httpResponse = $this->httpClient->request('POST', $this->getEndpoint(), [], $data->asXML());
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/SecureXMLAuthorizeRequestTest.php
Expand Up @@ -45,7 +45,7 @@ public function testSendSuccess()
$this->assertNotNull($response->getTransactionId());
$this->assertSame('Approved', $response->getMessage());
$this->assertSame('00', $response->getCode());
$this->assertSame('0', (string) $data->Payment->TxnList->Txn->txnType);
$this->assertSame('10', (string) $data->Payment->TxnList->Txn->txnType);
}

public function testSendFailure()
Expand Down
10 changes: 5 additions & 5 deletions tests/Mock/SecureXMLAuthorizeRequestFail.txt
@@ -1,9 +1,9 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:19:48 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:20:01 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929

Expand All @@ -22,4 +22,4 @@ Content-Length: 929
<statusCode>510</statusCode>
<statusDescription>Unable To Connect To Server</statusDescription>
</Status>
</NABTransactMessage>
</NABTransactMessage>
8 changes: 4 additions & 4 deletions tests/Mock/SecureXMLAuthorizeRequestInsufficientFundsFail.txt
@@ -1,9 +1,9 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:19:48 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:20:01 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929

Expand Down
8 changes: 4 additions & 4 deletions tests/Mock/SecureXMLAuthorizeRequestInvalidMerchantFail.txt
@@ -1,9 +1,9 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:19:48 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:20:01 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929

Expand Down
8 changes: 4 additions & 4 deletions tests/Mock/SecureXMLAuthorizeRequestInvalidMerchantIDFail.txt
@@ -1,9 +1,9 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:19:48 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 19 Apr 2004 06:20:01 GMT
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929

Expand Down
6 changes: 3 additions & 3 deletions tests/Mock/SecureXMLAuthorizeRequestSuccess.txt
@@ -1,10 +1,10 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929

<?xml version="1.0" encoding="UTF-8" standalone="no"?><NABTransactMessage><MessageInfo><messageID>a246d3d2ff1a75298ebe54f21fe887</messageID><messageTimestamp>20182605172441033000+600</messageTimestamp><apiVersion>xml-4.2</apiVersion></MessageInfo><RequestType>Payment</RequestType><MerchantInfo><merchantID>XYZ0010</merchantID></MerchantInfo><Status><statusCode>000</statusCode><statusDescription>Normal</statusDescription></Status><Payment><TxnList count="1"><Txn ID="1"><txnType>0</txnType><txnSource>23</txnSource><amount>1200</amount><currency>AUD</currency><purchaseOrderNo>ORDER-ZYX8789</purchaseOrderNo><approved>Yes</approved><responseCode>00</responseCode><responseText>Approved</responseText><settlementDate>20180526</settlementDate><txnID>800055</txnID><authID>711736</authID><CreditCardInfo><pan>444433...111</pan><expiryDate>12/18</expiryDate><cardType>6</cardType><cardDescription>Visa</cardDescription></CreditCardInfo></Txn></TxnList></Payment></NABTransactMessage>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><NABTransactMessage><MessageInfo><messageID>a246d3d2ff1a75298ebe54f21fe887</messageID><messageTimestamp>20182605172441033000+600</messageTimestamp><apiVersion>xml-4.2</apiVersion></MessageInfo><RequestType>Payment</RequestType><MerchantInfo><merchantID>XYZ0010</merchantID></MerchantInfo><Status><statusCode>000</statusCode><statusDescription>Normal</statusDescription></Status><Payment><TxnList count="1"><Txn ID="1"><txnType>10</txnType><txnSource>23</txnSource><amount>1200</amount><currency>AUD</currency><purchaseOrderNo>ORDER-ZYX8789</purchaseOrderNo><approved>Yes</approved><responseCode>00</responseCode><responseText>Approved</responseText><settlementDate>20180526</settlementDate><txnID>800055</txnID><authID>711736</authID><CreditCardInfo><pan>444433...111</pan><expiryDate>12/18</expiryDate><cardType>6</cardType><cardDescription>Visa</cardDescription></CreditCardInfo></Txn></TxnList></Payment></NABTransactMessage>
4 changes: 2 additions & 2 deletions tests/Mock/SecureXMLEchoTestRequestSuccess.txt
@@ -1,8 +1,8 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/SecureXMLPurchaseRequestSendSuccess.txt
@@ -1,8 +1,8 @@
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Server: Apache/2.4.29 (Ubuntu)
Date: Sat, 26 May 2018 07:25:31 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 929
Expand Down

0 comments on commit 658c012

Please sign in to comment.