Skip to content

Commit b947b6b

Browse files
author
Peter
committed
Add shipping name, company to CreditCard. Add shipping data to Authorize.net request.
1 parent 3bfcfef commit b947b6b

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/Omnipay/Common/CreditCard.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,30 @@ public function setBillingPhone($value)
358358
return $this->setParameter('billingPhone', $value);
359359
}
360360

361+
public function getShippingFirstName() {
362+
return $this->getParameter('shippingFirstName');
363+
}
364+
365+
public function setShippingFirstName($value) {
366+
return $this->setParameter('shippingFirstName', $value);
367+
}
368+
369+
public function getShippingLastName() {
370+
return $this->getParameter('shippingLastName');
371+
}
372+
373+
public function setShippingLastName($value) {
374+
return $this->setParameter('shippingLastName', $value);
375+
}
376+
377+
public function getShippingCompany() {
378+
return $this->getParameter('shippingCompany');
379+
}
380+
381+
public function setShippingCompany($value) {
382+
return $this->setParameter('shippingCompany', $value);
383+
}
384+
361385
public function getShippingAddress1()
362386
{
363387
return $this->getParameter('shippingAddress1');

tests/Omnipay/Common/CreditCardTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,24 @@ public function testBillingPhone()
321321
$this->assertSame('12345', $this->card->getPhone());
322322
}
323323

324+
public function testShippingFirstName()
325+
{
326+
$this->card->setShippingFirstName('James Bond');
327+
$this->assertEquals('James Bond', $this->getShippingFirstName());
328+
}
329+
330+
public function testShippingLastName()
331+
{
332+
$this->card->setShippingLastName('Doctor No');
333+
$this->assertEquals('Doctor No', $this->getShippingLastName());
334+
}
335+
336+
public function testShippingCompany()
337+
{
338+
$this->card->setShippingCompany('SuperSoft');
339+
$this->assertEquals('SuperSoft', $this->getShippingCompany());
340+
}
341+
324342
public function testShippingAddress1()
325343
{
326344
$this->card->setShippingAddress1('31 Spooner St');

0 commit comments

Comments
 (0)