22/**
33 * eWAY Rapid Direct Abstract Request
44 */
5-
5+
66namespace Omnipay \Eway \Message ;
77
88/**
@@ -18,7 +18,7 @@ public function getEncryptedCardNumber()
1818 {
1919 return $ this ->getParameter ('encryptedCardNumber ' );
2020 }
21-
21+
2222 /**
2323 * Sets the encrypted card number, for use when submitting card data
2424 * encrypted using eWAY's client side encryption.
@@ -30,7 +30,7 @@ public function setEncryptedCardNumber($value)
3030 {
3131 return $ this ->setParameter ('encryptedCardNumber ' , $ value );
3232 }
33-
33+
3434 public function getEncryptedCardCvv ()
3535 {
3636 return $ this ->getParameter ('encryptedCardCvv ' );
@@ -47,32 +47,31 @@ public function setEncryptedCardCvv($value)
4747 {
4848 return $ this ->setParameter ('encryptedCardCvv ' , $ value );
4949 }
50-
50+
5151 protected function getBaseData ()
5252 {
53-
5453 $ data = parent ::getBaseData ();
5554 $ data ['TransactionType ' ] = $ this ->getTransactionType ();
56-
55+
5756 if ($ this ->getCardReference ()) {
5857 $ data ['Customer ' ]['TokenCustomerID ' ] = $ this ->getCardReference ();
5958 } else {
6059 $ this ->validate ('card ' );
6160 }
62-
61+
6362 if ($ this ->getCard ()) {
6463 $ data ['Customer ' ]['CardDetails ' ] = array ();
6564 $ data ['Customer ' ]['CardDetails ' ]['Name ' ] = $ this ->getCard ()->getName ();
6665 $ data ['Customer ' ]['CardDetails ' ]['ExpiryMonth ' ] = $ this ->getCard ()->getExpiryDate ('m ' );
6766 $ data ['Customer ' ]['CardDetails ' ]['ExpiryYear ' ] = $ this ->getCard ()->getExpiryDate ('y ' );
6867 $ data ['Customer ' ]['CardDetails ' ]['CVN ' ] = $ this ->getCard ()->getCvv ();
69-
68+
7069 if ($ this ->getEncryptedCardNumber ()) {
7170 $ data ['Customer ' ]['CardDetails ' ]['Number ' ] = $ this ->getEncryptedCardNumber ();
7271 } else {
7372 $ data ['Customer ' ]['CardDetails ' ]['Number ' ] = $ this ->getCard ()->getNumber ();
7473 }
75-
74+
7675 if ($ this ->getEncryptedCardCvv ()) {
7776 $ data ['Customer ' ]['CardDetails ' ]['CVN ' ] = $ this ->getEncryptedCardCvv ();
7877 } else {
@@ -83,7 +82,7 @@ protected function getBaseData()
8382 $ data ['Customer ' ]['CardDetails ' ]['StartMonth ' ] = $ this ->getCard ()->getStartDate ('m ' );
8483 $ data ['Customer ' ]['CardDetails ' ]['StartYear ' ] = $ this ->getCard ()->getStartDate ('y ' );
8584 }
86-
85+
8786 if ($ this ->getCard ()->getIssueNumber ()) {
8887 $ data ['Customer ' ]['CardDetails ' ]['IssueNumber ' ] = $ this ->getCard ()->getIssueNumber ();
8988 }
0 commit comments