Skip to content

Commit a4b3396

Browse files
committed
Add support for a third address line parameter
1 parent 0d1f448 commit a4b3396

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

src/Common/CreditCard.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
* * company
4545
* * address1
4646
* * address2
47+
* * address3
4748
* * city
4849
* * postcode
4950
* * state
@@ -66,6 +67,7 @@
6667
* * billingCompany
6768
* * billingAddress1
6869
* * billingAddress2
70+
* * billingAddress3
6971
* * billingCity
7072
* * billingPostcode
7173
* * billingState
@@ -79,6 +81,7 @@
7981
* * shippingCompany
8082
* * shippingAddress1
8183
* * shippingAddress2
84+
* * shippingAddress3
8285
* * shippingCity
8386
* * shippingPostcode
8487
* * shippingState
@@ -791,6 +794,27 @@ public function setBillingAddress2($value)
791794
return $this->setParameter('billingAddress2', $value);
792795
}
793796

797+
/**
798+
* Get the billing address, line 3.
799+
*
800+
* @return string
801+
*/
802+
public function getBillingAddress3()
803+
{
804+
return $this->getParameter('billingAddress3');
805+
}
806+
807+
/**
808+
* Sets the billing address, line 3.
809+
*
810+
* @param string $value
811+
* @return $this
812+
*/
813+
public function setBillingAddress3($value)
814+
{
815+
return $this->setParameter('billingAddress3', $value);
816+
}
817+
794818
/**
795819
* Get the billing city.
796820
*
@@ -1090,6 +1114,27 @@ public function setShippingAddress2($value)
10901114
return $this->setParameter('shippingAddress2', $value);
10911115
}
10921116

1117+
/**
1118+
* Get the shipping address, line 3.
1119+
*
1120+
* @return string
1121+
*/
1122+
public function getShippingAddress3()
1123+
{
1124+
return $this->getParameter('shippingAddress3');
1125+
}
1126+
1127+
/**
1128+
* Sets the shipping address, line 3.
1129+
*
1130+
* @param string $value
1131+
* @return $this
1132+
*/
1133+
public function setShippingAddress3($value)
1134+
{
1135+
return $this->setParameter('shippingAddress3', $value);
1136+
}
1137+
10931138
/**
10941139
* Get the shipping city.
10951140
*
@@ -1285,6 +1330,30 @@ public function setAddress2($value)
12851330
return $this;
12861331
}
12871332

1333+
/**
1334+
* Get the billing address, line 3.
1335+
*
1336+
* @return string
1337+
*/
1338+
public function getAddress3()
1339+
{
1340+
return $this->getParameter('billingAddress3');
1341+
}
1342+
1343+
/**
1344+
* Sets the billing and shipping address, line 3.
1345+
*
1346+
* @param string $value
1347+
* @return $this
1348+
*/
1349+
public function setAddress3($value)
1350+
{
1351+
$this->setParameter('billingAddress3', $value);
1352+
$this->setParameter('shippingAddress3', $value);
1353+
1354+
return $this;
1355+
}
1356+
12881357
/**
12891358
* Get the billing city.
12901359
*

tests/Omnipay/Common/CreditCardTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ public function testBillingAddress2()
428428
$this->assertEquals('Suburb', $this->card->getAddress2());
429429
}
430430

431+
public function testBillingAddress3()
432+
{
433+
$this->card->setBillingAddress3('Building C, Room 308');
434+
$this->assertEquals('Building C, Room 308', $this->card->getBillingAddress3());
435+
$this->assertEquals('Building C, Room 308', $this->card->getAddress3());
436+
}
437+
431438
public function testBillingCity()
432439
{
433440
$this->card->setBillingCity('Quahog');
@@ -524,6 +531,12 @@ public function testShippingAddress2()
524531
$this->assertEquals('Suburb', $this->card->getShippingAddress2());
525532
}
526533

534+
public function testShippingAddress3()
535+
{
536+
$this->card->setShippingAddress3('Building C, Room 308');
537+
$this->assertEquals('Building C, Room 308', $this->card->getShippingAddress3());
538+
}
539+
527540
public function testShippingCity()
528541
{
529542
$this->card->setShippingCity('Quahog');
@@ -590,6 +603,14 @@ public function testAddress2()
590603
$this->assertEquals('Suburb', $this->card->getShippingAddress2());
591604
}
592605

606+
public function testAddress3()
607+
{
608+
$this->card->setAddress3('Building C, Room 308');
609+
$this->assertEquals('Building C, Room 308', $this->card->getAddress3());
610+
$this->assertEquals('Building C, Room 308', $this->card->getBillingAddress3());
611+
$this->assertEquals('Building C, Room 308', $this->card->getShippingAddress3());
612+
}
613+
593614
public function testCity()
594615
{
595616
$this->card->setCity('Quahog');

0 commit comments

Comments
 (0)