npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

paypay-ao-sdk

v2.0.0

Published

SDK oficial para integração de pagamentos PayPay AO - TypeScript

Readme

PayPay AO SDK

npm version License: MIT TypeScript

SDK oficial para integração de pagamentos PayPay Angola. Suporte completo para MULTICAIXA Express, MULTICAIXA Reference e PayPay App.

🚀 Características

  • MULTICAIXA Express - Pagamentos imediatos via número de telefone
  • MULTICAIXA Reference - Pagamentos por referência
  • PayPay App - Pagamentos via aplicação móvel
  • TypeScript - Tipagem completa para melhor experiência de desenvolvimento
  • Segurança - Criptografia RSA PKCS1 e assinaturas SHA1withRSA
  • Validação - Validação robusta de dados de entrada

📦 Instalação

npm install paypay-ao-sdk

ou

pnpm add paypay-ao-sdk

🔧 Configuração Inicial

1. Obter Credenciais

Para usar o SDK, você precisará de:

  • Partner ID - Identificador do merchant
  • Chave Privada RSA - Para assinar requisições
  • Chave Pública PayPay - Para verificar respostas
  • Sale Product Code - Código Único do produto fornecido pelo suporte Pay Pay
  • API URL - Url autorizada da API fornecido pelo suporte Pay Pay

2. Inicialização Básica

const PayPaySDK = require('paypay-ao-sdk');

const sdk = new PayPaySDK({
  partnerId: 'SEU PARTNER ID',
  privateKey: `-----BEGIN PRIVATE KEY-----
SUA_CHAVE_PRIVADA_RSA
-----END PRIVATE KEY-----`,
  paypayPublicKey: `-----BEGIN PUBLIC KEY-----
CHAVE_PUBLICA_PAYPAY
-----END PUBLIC KEY-----`,
  language: 'pt/en',
  saleProductCode: 'Codigo do produto',
  apiUrl:'URL da API'
});

💳 Uso Básico

Express

Pagamento imediato processado diretamente via número de telefone:

try {
  const outTradeNo = PayPaySDK.generateUniqueOrderNo("MUL-");
  const resp = await sdk.createMulticaixaPayment({
      outTradeNo,
      amount: amount,
      phoneNum: phoneNum,
      payerIp: ip,
  });
  console.log(resp);
} catch (error) {
  console.error('Falha na requisição:', error.message);
}

Reference

Pagamento por referência para processamento posterior:

const outTradeNo = PayPaySDK.generateUniqueOrderNo("REF-");
const resp = await sdk.createReferencePayment({
    outTradeNo,
    amount: amount,
    payerIp: ip,
});
console.log(resp);

PayPay App

Pagamento via aplicação móvel com QR Code ou Deep Link:

const outTradeNo = PayPaySDK.generateUniqueOrderNo("PAYPAY-");
const resp = await sdk.createPayPayAppPayment({
    outTradeNo,
    amount: amount,
    payerIp: ip,
});
console.log(resp);

🔍 Exemplos Avançados

Validação de Dados

// Validar número de telefone
const phoneValidation = PayPaySDK.validatePhoneNumber('900123456');
if (phoneValidation.isValid) {
  console.log('Telefone formatado:', phoneValidation.formatted);
}

// Validar montante
const amountValidation = PayPaySDK.validateAmount(1000);
if (!amountValidation.isValid) {
  console.error('Erros:', amountValidation.errors);
}

// Gerar número de transação único
const tradeNo = PayPaySDK.generateUniqueOrderNo('ORDER_');
console.log('Trade Number:', tradeNo);

📊 Fluxo de Pagamento

MULTICAIXA Express

sequenceDiagram
    participant App as Sua Aplicação
    participant SDK as PayPay SDK
    participant API as PayPay API
    participant User as Utilizador
    
    App->>SDK: createMulticaixaPayment()
    SDK->>SDK: Validar dados
    SDK->>SDK: Encriptar conteúdo
    SDK->>SDK: Gerar assinatura
    SDK->>API: POST /gateway/recv.do
    API-->>SDK: Resposta com link dinâmico
    SDK-->>App: PaymentResponse
    App->>User: Apresentar link/QR
    User->>API: Confirmar pagamento
    API-->>App: Callback (webhook)

PayPay App

sequenceDiagram
    participant App as Sua Aplicação
    participant SDK as PayPay SDK
    participant API as PayPay API
    participant PayPay as App PayPay
    
    App->>SDK: createPayPayAppPayment()
    SDK->>API: Criar pagamento
    API-->>SDK: Link dinâmico
    SDK-->>App: PaymentResponse
    App->>PayPay: Redirecionar/QR Code
    PayPay->>API: Processar pagamento
    API-->>App: Notificação

⚠️ Limitações e Considerações

Limites de Montante

  • Mínimo: 1 AOA
  • Máximo: 10.000.000.000.000 AOA

Timeouts

  • Padrão: 15 minutos
  • Máximo: 30 minutos
  • Mínimo: 5 minutos

Formatos Suportados

  • Números de telefone: 244XXXXXXXXX ou 9XXXXXXXX
  • Moeda: Apenas AOA (Kwanza Angolano)
  • Codificação: UTF-8

🤝 Contribuição

Contribuições são bem-vindas! Por favor, leia nosso guia de contribuição antes de submeter pull requests.

📄 Licença

Este projeto está licenciado sob a Licença MIT - veja o arquivo LICENSE para detalhes.

📞 Suporte

Para suporte técnico, entre em contato:

  • Email: [email protected]
  • Documentação: https://portal.paypayafrica.com/passport/apidoc/guide

Desenvolvido com ❤️ por anvimaa