Omnipay\Common\CreditCard::setBillingName PHP Method

setBillingName() public method

Sets the card billing name.
public setBillingName ( string $value ) : CreditCard
$value string
return CreditCard provides a fluent interface.
    public function setBillingName($value)
    {
        $names = explode(' ', $value, 2);
        $this->setBillingFirstName($names[0]);
        $this->setBillingLastName(isset($names[1]) ? $names[1] : null);
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testBillingName()
 {
     $this->card->setBillingFirstName('Bob');
     $this->card->setBillingLastName('Smith');
     $this->assertEquals('Bob Smith', $this->card->getBillingName());
     $this->card->setBillingName('John Foo');
     $this->assertEquals('John', $this->card->getBillingFirstName());
     $this->assertEquals('Foo', $this->card->getBillingLastName());
 }
CreditCard