src/Resource/Customer.php
public function setCreditCard($expirationMonth, $expirationYear, $number, $cvc, Holder $holder = null)
    {
        if ($holder === null) {
            $holder = $this;
        }
        $birthdate = $holder->getBirthDate();
        if ($birthdate instanceof \DateTime) {
            $birthdate = $birthdate->format('Y-m-d');
        }

        $this->data->fundingInstrument = new stdClass();
        $this->data->fundingInstrument->method = Payment::METHOD_CREDIT_CARD;
        $this->data->fundingInstrument->creditCard = new stdClass();
        $this->data->fundingInstrument->creditCard->expirationMonth = $expirationMonth;
        $this->data->fundingInstrument->creditCard->expirationYear = $expirationYear;
        $this->data->fundingInstrument->creditCard->number = $number;
        $this->data->fundingInstrument->creditCard->cvc = $cvc;
        $this->data->fundingInstrument->creditCard->holder = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->fullname = $holder->getFullname();
        $this->data->fundingInstrument->creditCard->holder->birthdate = $birthdate;
        $this->data->fundingInstrument->creditCard->holder->taxDocument = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->taxDocument->type = $holder->getTaxDocumentType();
        $this->data->fundingInstrument->creditCard->holder->taxDocument->number = $holder->getTaxDocumentNumber();
        $this->data->fundingInstrument->creditCard->holder->phone = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->phone->countryCode = $holder->getPhoneCountryCode();
        $this->data->fundingInstrument->creditCard->holder->phone->areaCode = $holder->getPhoneAreaCode();
        $this->data->fundingInstrument->creditCard->holder->phone->number = $holder->getPhoneNumber();

        return $this;
    }
public function setCreditCard($expirationMonth, $expirationYear, $number, $cvc, Holder $holder = null)
    {
        if ($holder === null) {
            $holder = $this;
        }
        $birthdate = $holder->getBirthDate();
        if ($birthdate instanceof \DateTime) {
            $birthdate = $birthdate->format('Y-m-d');
        }

        $this->data->fundingInstrument = new stdClass();
        $this->data->fundingInstrument->method = Payment::METHOD_CREDIT_CARD;
        $this->data->fundingInstrument->creditCard = new stdClass();
        $this->data->fundingInstrument->creditCard->expirationMonth = $expirationMonth;
        $this->data->fundingInstrument->creditCard->expirationYear = $expirationYear;
        $this->data->fundingInstrument->creditCard->number = $number;
        $this->data->fundingInstrument->creditCard->cvc = $cvc;
        $this->data->fundingInstrument->creditCard->holder = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->fullname = $holder->getFullname();
        $this->data->fundingInstrument->creditCard->holder->birthdate = $birthdate;
        $this->data->fundingInstrument->creditCard->holder->taxDocument = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->taxDocument->type = $holder->getTaxDocumentType();
        $this->data->fundingInstrument->creditCard->holder->taxDocument->number = $holder->getTaxDocumentNumber();
        $this->data->fundingInstrument->creditCard->holder->phone = new stdClass();
        $this->data->fundingInstrument->creditCard->holder->phone->countryCode = $holder->getPhoneCountryCode();
        $this->data->fundingInstrument->creditCard->holder->phone->areaCode = $holder->getPhoneAreaCode();
        $this->data->fundingInstrument->creditCard->holder->phone->number = $holder->getPhoneNumber();

        return $this;
    }
public function setCreditCard ( $ expirationMonth , $ expirationYear , $ number , $ cvc , Holder $ holder = null ) { if ( $ holder === null ) { $ holder = $ this ; } $ birthdate = $ holder -> getBirthDate ( ) ; if ( $ birthdate instanceof \ DateTime ) { $ birthdate = $ birthdate -> format ( 'Y-m-d' ) ; } $ this -> data -> fundingInstrument = new stdClass ( ) ; $ this -> data -> fundingInstrument -> method = Payment :: METHOD_CREDIT_CARD ; $ this -> data -> fundingInstrument -> creditCard = new stdClass ( ) ; $ this -> data -> fundingInstrument -> creditCard -> expirationMonth = $ expirationMonth ; $ this -> data -> fundingInstrument -> creditCard -> expirationYear = $ expirationYear ; $ this -> data -> fundingInstrument -> creditCard -> number = $ number ; $ this -> data -> fundingInstrument -> creditCard -> cvc = $ cvc ; $ this -> data -> fundingInstrument -> creditCard -> holder = new stdClass ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> fullname = $ holder -> getFullname ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> birthdate = $ birthdate ; $ this -> data -> fundingInstrument -> creditCard -> holder -> taxDocument = new stdClass ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> taxDocument -> type = $ holder -> getTaxDocumentType ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> taxDocument -> number = $ holder -> getTaxDocumentNumber ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> phone = new stdClass ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> phone -> countryCode = $ holder -> getPhoneCountryCode ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> phone -> areaCode = $ holder -> getPhoneAreaCode ( ) ; $ this -> data -> fundingInstrument -> creditCard -> holder -> phone -> number = $ holder -> getPhoneNumber ( ) ; return $ this ; }
Set credit card from customer.

@param int                          $expirationMonth Card expiration month.
@param int                          $expirationYear  Year card expiration.
@param int                          $number          Card number.
@param int                          $cvc             Card Security Code.
@param \Moip\Resource\Customer|null $holder          Cardholder.

@return $this
Set credit card from customer .