Giter Club home page Giter Club logo

asaas-sdk's People

Contributors

dersonsena avatar moisesk avatar

Stargazers

 avatar  avatar

Watchers

 avatar

asaas-sdk's Issues

Adicionar Exception quando Telefone enviado é inválido

O SDK deverá disparar uma Exception InvalidPhoneException quando a API retornar esse erro:

if ($responsePayload['errors'][0]['description'] === 'O telefone informado é inválido.') {
                throw new ValidationException([
                    'field' => 'phone',
                    'error' => 'invalidPhone',
                    'value' => $phone
                ]);
            }

Tratar erro Unauthorized

Na classe CreatePixChargeGateway na linha 46, onde são capturadas as exceptions, quando é retornado um erro 401 o resultado não vem no formato JSON e sim em texto puro. Devemos tratar isso para garantir que sempre será retornado um JSON para o usuário final.

"Client error: `POST https://www.asaas.com/api/v3/payments` resulted in a `401 Unauthorized` response"

Adicionar um Exception quando CPF ou CNPJ foi inválido

O SDK deverá disparar uma Exception InvalidCpfOrCnpjException quando a API retornar esse erro:

$responsePayload = $e->getResponsePayload();

if ($responsePayload['errors'][0]['description'] === 'O CPF ou CNPJ informado é inválido.') {
    throw new InvalidCpfOrCnpjException($cpfOrCnpj);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.