Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
node-pagseguro2
Advanced tools
Biblioteca de integração PagSeguro UOL com checkout transparente para Node.js
npm install node-pagseguro2
var PagSeguro = require('node-pagseguro2');
var payment = new PagSeguro({
email: 'email@account.com',
token: 'ABCDEFGH12345678ABCDEFGH12345678',
currency: '' //opcional - default BRL
})
ou
var PagSeguro = require('node-pagseguro2');
var payment = new PagSeguro({
email: 'email@account.com',
token: 'ABCDEFGH12345678ABCDEFGH12345678',
sandbox: 0,
sandbox_email: '123123123123123@sandbox.pagseguro.com.br'
})
Para utilizar o modo Sandbox é necessário configurar com o e-mail obtido nas configurações do PagSeguro Sandbox e passar o valor 1 para o parâmetro 'sandbox'.
var payment = new PagSeguro({
email: 'email@account.com',
token: 'ABCDEFGH12345678ABCDEFGH12345678',
sandbox: 1,
sandbox_email: '123123123123123@sandbox.pagseguro.com.br'
})
payment.setSender({
name: String,
email: String,
cpf_cnpj: String,
area_code: String,
phone: String,
birth_date: String //formato dd/mm/yyyy
})
Utilizar essa função apenas se o proprietário do cartão de crédito for diferente do comprador
payment.setCreditCardHolder({
name: String,
cpf_cnpj: String,
area_code: String,
phone: String,
birth_date: String //formato dd/mm/yyyy
})
payment.setShipping({
street: String,
number: String,
district: String,
city: String,
state: String,
postal_code: String,
same_for_billing: Boolean //opcional, informar se o endereço de entrega for o mesmo do endereço de cobrança
})
Se a propriedade same_for_billing
do endereço de entrega (shipping) não for definido, os dados de cobrança são obrigatórios
payment.setBilling({
street: String,
number: String,
district: String,
city: String,
state: String,
postal_code: String
})
payment.addItem({
qtde: Number,
value: Number,
description: String
})
payment.sessionId(function(err, session_id) {
});
No pagamento com cartão de crédito é preciso gerar o token do cartão de crédito a partir da biblioteca do PagSeguro (https://devs.pagseguro.uol.com.br/docs/checkout-web-usando-a-sua-tela#obter-token-de-cartao)
payment.sendTransaction({
method: String, //'boleto' ou 'creditCard'
credit_card_token: String, //token do cartão de crédito
value: Number,
installments: Number, //opcional, padrão 1
extra_amount: Number, //opcional, padrão 0
reference: String, //opcional, padrão vazio - string identificadora do pedido
hash: String //senderHash gerado pela biblioteca do PagSeguro
}, function(err, data) {
});
payment.transactionStatus(code: String, function(err, data) {
});
payment.notificationStatus(notificationCode: String, function(err, data) {
/**
* data = {
transaction: String,
statuscode: Number,
reference: String,
status: String,
date: String
}
*/
});
FAQs
Integração PagSeguro UOL com checkout transparente para servidores backend
The npm package node-pagseguro2 receives a total of 10 weekly downloads. As such, node-pagseguro2 popularity was classified as not popular.
We found that node-pagseguro2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.