Skip to content

Commit e0a5397

Browse files
Marginal error handling
1 parent ccea9d5 commit e0a5397

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CRM/Core/Payment/OmnipayMultiProcessor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,10 @@ public function queryPaymentPlans($params) {
731731
public function query($params) {
732732
$this->createGateway($this->_paymentProcessor['id']);
733733
$response = $this->gateway->query($params)->send();
734-
return $response->getData();
734+
if ($response->isSuccessful()) {
735+
return $response->getData();
736+
}
737+
throw new CRM_Core_Exception('Failed to retrieve data');
735738
}
736739

737740
/**

vendor/omnipay/authorizenet/src/Message/QueryBatchResponse.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ public function __construct(AbstractRequest $request, $data)
3838

3939
public function isSuccessful()
4040
{
41-
return 1 === $this->getResultCode();
41+
return 'Ok' === $this->getResultCode();
42+
}
43+
44+
public function getResultCode() {
45+
$result = $this->xml2array($this->data->messages, TRUE);
46+
return $result['messages'][0]['resultCode'];
4247
}
4348

4449
public function getData() {

0 commit comments

Comments
 (0)