Skip to content

Commit 75053ac

Browse files
committed
Updates
1 parent 059202e commit 75053ac

File tree

7 files changed

+8
-19
lines changed

7 files changed

+8
-19
lines changed

src/Omnipay/Eway/Message/DirectAbstractRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ abstract class DirectAbstractRequest extends AbstractRequest
1212

1313
public function sendData($data)
1414
{
15-
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();
15+
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data->asXML())->send();
1616

17-
return $this->response = new DirectResponse($this, $httpResponse->getBody());
17+
return $this->response = new DirectResponse($this, $httpResponse->xml());
1818
}
1919

2020
public function getCustomerId()

src/Omnipay/Eway/Message/DirectAuthorizeRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public function getData()
4848
$sxml->addChild('ewayCustomerInvoiceDescription', $this->getDescription());
4949
$sxml->addChild('ewayCustomerInvoiceRef', $this->getTransactionReference());
5050

51-
return $sxml->asXML();
51+
return $sxml;
5252
}
5353
}

src/Omnipay/Eway/Message/DirectCaptureRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function getData()
3333
$sxml->addChild('ewayOption2', $this->getOption2());
3434
$sxml->addChild('ewayOption3', $this->getOption3());
3535

36-
return $sxml->asXML();
36+
return $sxml;
3737
}
3838
}

src/Omnipay/Eway/Message/DirectPurchaseRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public function getData()
4848
$sxml->addChild('ewayCustomerInvoiceDescription', $this->getDescription());
4949
$sxml->addChild('ewayCustomerInvoiceRef', $this->getTransactionReference());
5050

51-
return $sxml->asXML();
51+
return $sxml;
5252
}
5353
}

src/Omnipay/Eway/Message/DirectRefundRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public function getData()
4848
$sxml->addChild('ewayRefundPassword', $this->getRefundPassword());
4949
$sxml->addChild('ewayCustomerInvoiceRef', $this->getTransactionReference());
5050

51-
return $sxml->asXML();
51+
return $sxml;
5252
}
5353
}

src/Omnipay/Eway/Message/DirectResponse.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,9 @@
1111
*/
1212
class DirectResponse extends AbstractResponse
1313
{
14-
public function __construct(RequestInterface $request, $data)
15-
{
16-
$this->request = $request;
17-
18-
try {
19-
$this->data = new \SimpleXMLElement($data);
20-
} catch (\Exception $e) {
21-
throw new InvalidResponseException();
22-
}
23-
}
24-
2514
public function isSuccessful()
2615
{
27-
return ($this->data->ewayTrxnStatus == "True");
16+
return "True" === (string) $this->data->ewayTrxnStatus;
2817
}
2918

3019
public function isRedirect()

src/Omnipay/Eway/Message/DirectVoidRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function getData()
3030
$sxml->addChild('ewayOption2', $this->getOption2());
3131
$sxml->addChild('ewayOption3', $this->getOption3());
3232

33-
return $sxml->asXML();
33+
return $sxml;
3434
}
3535
}

0 commit comments

Comments
 (0)