Skip to content

Commit

Permalink
Merge pull request #16 from juriansluiman/hotfix/status-success-tags
Browse files Browse the repository at this point in the history
StandardClient()->protected function getTag(DOMNode $node, $tag) triggers notice when action is cancelled
  • Loading branch information
Jurian Sluiman committed Sep 17, 2013
2 parents 4ab2927 + 1f98ef3 commit 74f45f1
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/SlmIdealPayment/Client/StandardClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,25 @@ public function sendStatusRequest(Request\StatusRequest $request)
throw new Exception\IdealRequestException('Expecting AcquirerStatusRes as root element in response');
}

$status = $this->getTag($response, 'status');
$transaction = new Model\Transaction();
$transaction->setTransactionId($this->getTag($response, 'transactionID'));
$transaction->setStatus($this->getTag($response, 'status'));
// @todo add statusDateTimestamp
$transaction->setStatus($status);

$consumer = new Model\Consumer();
$consumer->setName($this->getTag($response, 'consumerName'));
$consumer->setAccountIBAN($this->getTag($response, 'consumerIBAN'));
$consumer->setAccountBIC($this->getTag($response, 'consumerBIC'));
if ($status !== Model\Transaction::STATUS_OPEN) {
// @todo add statusDateTimestamp
}

if ($status === Model\Transaction::STATUS_SUCCESS) {
$consumer = new Model\Consumer();
$consumer->setName($this->getTag($response, 'consumerName'));
$consumer->setAccountIBAN($this->getTag($response, 'consumerIBAN'));
$consumer->setAccountBIC($this->getTag($response, 'consumerBIC'));

$transaction->setAmount($this->getTag($response, 'amount'));
$transaction->setCurrency($this->getTag($response, 'currency'));
$transaction->setConsumer($consumer);
$transaction->setAmount($this->getTag($response, 'amount'));
$transaction->setCurrency($this->getTag($response, 'currency'));
$transaction->setConsumer($consumer);
}

$response = new Response\TransactionResponse();
$response->setTransaction($transaction);
Expand Down

0 comments on commit 74f45f1

Please sign in to comment.