protected function _instantiateCreditCard($data)
    {
        if ($data->token) {
            unset($data['creditcard']);
            unset($data['contact']);
            return;
        }

        $data->append(array(
            'creditcard' => new AnConfig(),
        ));

        $creditcard = $data->creditcard;
        $name = trim($creditcard->name);
        $space = AnHelperString::strpos($name, ' ');

        $creditcard_data = array(
            'type' => $creditcard->type,
            'first_name' => AnHelperString::ucwords(AnHelperString::substr($name, 0, $space)),
            'last_name' => AnHelperString::ucwords(AnHelperString::substr($name, $space + 1)),
            'number' => $creditcard->number,
            'month' => $creditcard->month,
            'year' => $creditcard->year,
            'verification_value' => $creditcard->csv,
        );

        $creditcard = new Merchant_Billing_CreditCard($creditcard_data);
        $this->creditcard = $creditcard;
        $contact = $this->_instantiateContact($data);
        $this->order->setPaymentMethod(new ComSubscriptionsDomainPaymentMethodCreditcard($creditcard, $contact));

        return $creditcard;
    }
protected function _instantiateCreditCard($data)
    {
        if ($data->token) {
            unset($data['creditcard']);
            unset($data['contact']);
            return;
        }

        $data->append(array(
            'creditcard' => new AnConfig(),
        ));

        $creditcard = $data->creditcard;
        $name = trim($creditcard->name);
        $space = AnHelperString::strpos($name, ' ');

        $creditcard_data = array(
            'type' => $creditcard->type,
            'first_name' => AnHelperString::ucwords(AnHelperString::substr($name, 0, $space)),
            'last_name' => AnHelperString::ucwords(AnHelperString::substr($name, $space + 1)),
            'number' => $creditcard->number,
            'month' => $creditcard->month,
            'year' => $creditcard->year,
            'verification_value' => $creditcard->csv,
        );

        $creditcard = new Merchant_Billing_CreditCard($creditcard_data);
        $this->creditcard = $creditcard;
        $contact = $this->_instantiateContact($data);
        $this->order->setPaymentMethod(new ComSubscriptionsDomainPaymentMethodCreditcard($creditcard, $contact));

        return $creditcard;
    }
protected function _instantiateCreditCard ( $ data ) { if ( $ data -> token ) { unset ( $ data [ 'creditcard' ] ) ; unset ( $ data [ 'contact' ] ) ; return ; } $ data -> append ( array ( 'creditcard' => new AnConfig ( ) , ) ) ; $ creditcard = $ data -> creditcard ; $ name = trim ( $ creditcard -> name ) ; $ space = AnHelperString :: strpos ( $ name , ' ' ) ; $ creditcard_data = array ( 'type' => $ creditcard -> type , 'first_name' => AnHelperString :: ucwords ( AnHelperString :: substr ( $ name , 0 , $ space ) ) , 'last_name' => AnHelperString :: ucwords ( AnHelperString :: substr ( $ name , $ space + 1 ) ) , 'number' => $ creditcard -> number , 'month' => $ creditcard -> month , 'year' => $ creditcard -> year , 'verification_value' => $ creditcard -> csv , ) ; $ creditcard = new Merchant_Billing_CreditCard ( $ creditcard_data ) ; $ this -> creditcard = $ creditcard ; $ contact = $ this -> _instantiateContact ( $ data ) ; $ this -> order -> setPaymentMethod ( new ComSubscriptionsDomainPaymentMethodCreditcard ( $ creditcard , $ contact ) ) ; return $ creditcard ; }
Instantiate a Merchant_Billing_CreditCard object.

@param AnConfig $data

@return Merchant_Billing_CreditCard
Instantiate a Merchant_Billing_CreditCard object .