public function addPaymentMethod($paymentId, IPaymentMethod $paymentMethod)
    {
        $nameOnAccount = sprintf('%s %s', $this->firstName, $this->lastName);
        if (empty(str_replace(' ', '', $nameOnAccount))) {
            $nameOnAccount = $this->company;
        }

        $payment = new RecurringPaymentMethod($paymentMethod);
        $payment->address = $this->address;
        $payment->customerKey = $this->key;
        $payment->id = $paymentId;
        $payment->nameOnAccount = $nameOnAccount;
        return $payment;
    }
public function addPaymentMethod($paymentId, IPaymentMethod $paymentMethod)
    {
        $nameOnAccount = sprintf('%s %s', $this->firstName, $this->lastName);
        if (empty(str_replace(' ', '', $nameOnAccount))) {
            $nameOnAccount = $this->company;
        }

        $payment = new RecurringPaymentMethod($paymentMethod);
        $payment->address = $this->address;
        $payment->customerKey = $this->key;
        $payment->id = $paymentId;
        $payment->nameOnAccount = $nameOnAccount;
        return $payment;
    }
public function addPaymentMethod ( $ paymentId , IPaymentMethod $ paymentMethod ) { $ nameOnAccount = sprintf ( '%s %s' , $ this -> firstName , $ this -> lastName ) ; if ( empty ( str_replace ( ' ' , '' , $ nameOnAccount ) ) ) { $ nameOnAccount = $ this -> company ; } $ payment = new RecurringPaymentMethod ( $ paymentMethod ) ; $ payment -> address = $ this -> address ; $ payment -> customerKey = $ this -> key ; $ payment -> id = $ paymentId ; $ payment -> nameOnAccount = $ nameOnAccount ; return $ payment ; }
Adds a payment method to the customer

@param string $paymentId An application derived ID for the payment method
@param IPaymentMethod $paymentMethod The payment method

@return RecurringPaymentMethod
Adds a payment method to the customer