Markette\Gopay\Entity\BasePayment::setCustomer PHP Method

setCustomer() public method

Sets customer data
public setCustomer ( $customer ) : self
return self
    public function setCustomer($customer)
    {
        $allowedKeys = ['firstName', 'lastName', 'street', 'city', 'postalCode', 'countryCode', 'email', 'phoneNumber'];
        $this->customer = (object) array_intersect_key((array) $customer, array_flip($allowedKeys));
        foreach ($allowedKeys as $key) {
            if (!isset($this->customer->{$key})) {
                $this->customer->{$key} = '';
            }
        }
        return $this;
    }