Skip to content

Commit 64feb21

Browse files
author
Maksim Rafalko
committed
check for cardReference as well as transactionReference
1 parent 197299f commit 64feb21

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Omnipay/NetBanx/Message/AuthorizeRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AuthorizeRequest extends AbstractRequest
3535
*/
3636
public function getData()
3737
{
38-
if ($this->getTransactionReference()) {
38+
if ($this->getTransactionReference() || $this->getCardReference()) {
3939
$this->txnMode = $this->getStoredDataMode();
4040
$this->validate('amount');
4141
} else {
@@ -57,7 +57,7 @@ public function getData()
5757
*/
5858
protected function getXmlString()
5959
{
60-
if ($this->getTransactionReference()) {
60+
if ($this->getTransactionReference() || $this->getCardReference()) {
6161
$xmlRoot = 'ccStoredDataRequestV1';
6262
} else {
6363
$xmlRoot = 'ccAuthRequestV1';
@@ -79,8 +79,8 @@ protected function getXmlString()
7979

8080
$sxml->addChild('merchantRefNum', $this->getCustomerId() ?: 'ref-num - ' . time());
8181

82-
if ($this->getTransactionReference()) {
83-
$sxml->addChild('confirmationNumber', $this->getTransactionReference());
82+
if ($this->getTransactionReference() || $this->getCardReference()) {
83+
$sxml->addChild('confirmationNumber', $this->getTransactionReference() ?: $this->getCardReference());
8484
$sxml->addChild('amount', $this->getAmountDecimal());
8585
} else {
8686
/** @var $card CreditCard */

0 commit comments

Comments
 (0)