1.0.9 • Published 2 years ago

bluelogic-payments v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Bluelogic Payment

Instalação

npm install bluelogic-payments ou yarn add bluelogic-payments

Exemplo de Uso

let payment = new PaymentService({token: "KEY"});// Ache sua chave API Iugu

Para pagamento com Cartão de Crédito:

let invoice = {
    "email": 'teste@teste.com.br',
    "due_date": moment(new Date(), "YYYY-MM-DD").format("DD/MM/YYYY"),
    "items": [
        {
            "description": 'Produto Teste',
            "price_cents": '10000',
            "quantity": 1
        }
],
    "payer": {
        "cpf_cnpj": '69868477000',
        "name": 'Maria',
        "address": {
            "zip_code": '64057280',
            "number": '1',
            "district": 'Teste',
            "street": 'Teste'
        }
    }
}
let creditCard = {
    "method": "credit_card",
    "test": true,
    "account_id": "ID_ACCOUNT_IUGU",
    "data": {
        "number": '5588266194843203',
        "verification_value": '127',
        "first_name": 'Teste',
        "last_name": 'Teste',
        "month": '11',
        "year": '25'
    }
}

await payment.payInvoiceWithCard(invoice, creditCard)

Para pagamento com PIX ou Boleto:

let invoice = {
    "email": 'teste@teste.com.br',
    "due_date": moment(new Date(), "YYYY-MM-DD").format("DD/MM/YYYY"),
    "items": [
        {
            "description": 'Produto Teste',
            "price_cents": '10000',
            "quantity": 1
        }
],
    "payer": {
        "cpf_cnpj": '69868477000',
        "name": 'Maria',
        "address": {
            "zip_code": '64057280',
            "number": '1',
            "district": 'Teste',
            "street": 'Teste'
        }
    }
}

await payment.payInvoice(invoice)

Autor

Originalmente por Fernando Esmaniotto.

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago