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

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

Open
juliolvfilho opened this issue Oct 29, 2019 · 0 comments
Open

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

juliolvfilho opened this issue Oct 29, 2019 · 0 comments

Comments

@juliolvfilho
Copy link

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();
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant