Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Erro ao criar pagamento sem definir o telefone do holder #313

Description

@juliolvfilho

Ao tentar criar um pagamento passando um objeto $holder sem telefone definido ocorre:
ErrorException: Undefined property: stdClass::$phone in .../vendor/moip/moip-sdk-php/src/Resource/Holder.php:120

Segundo a documentação o telefone só é obrigatório para o Venda Protegida, então, em teoria deveria ser possível criar pagamentos sem especificar o telefone do holder.

Estou contornando o problema passando string vazia para setPhone:

$holder = $moip->holders()
    ->setFullname('Fulano da Silva')
    ->setBirthDate('2000-12-25)
    ->setTaxDocument('90027971090') // 4devs.com.br/gerador_de_cpf
    ->setPhone('',''); // workaround for wirecard problem

$moipPayment = $order->payments()
     ->setCreditCardHash('D73EAN3y5VRMUw90y2woIcG631ag/Svs...')
    ->setInstallmentCount(1)
    ->setStatementDescriptor('Minha Empresa')
    ->execute();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions