0.11.6 • Published 4 years ago

plug-pag-service-pdv v0.11.6

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

plug-pag-service-pdv

React Native Plug Pag Service PDV365

Esta biblioteca destina-se a integradores que utilizarão os terminais da linha Smart do PagSeguro como solução de pagamento integrada através do serviço PlugPagService.

"react-native": ">=0.63.4 <0.59.0"

Instalação

plug-pag-service-pdv requer Node.js ou Yarn.

Instale a dependências.

npm install plug-pag-service-pdv ou yarn add npm plug-pag-service-pdv

Importação

import PlugPagService from 'plug-pag-service-pdv';

Exemplos

Número de série:

function handleGetSerialNumber() {
    PlugPagService.getSerialNumber()
      .then((initResult) => {
        console.log('success', initResult);
      }, error => {
        console.error('error', error.message);
      });
  }

Identificação de aplicativo:

 function handleSetAppIdendification() {
    PlugPagService.setAppIdendification("RNPAGA", "1.0")
  }

Evento Listener:

 const eventPaymentsManagerEmitter = new NativeEventEmitter(PlugPagService);
 const event = eventPaymentsManagerEmitter.addListener(
    'eventPayments',
    (reminder) => console.log(reminder)
  );

Inicializar e ativar o Pin pad:

 function handleInitializeAndActivatePinpad() {
    handleSetAppIdendification()
    PlugPagService.initializeAndActivatePinpad("codigo_ativação").then((initResult) => {
      if (initResult.retCode === PlugPagService.RET_OK) {
        // Define os dados do pagamento
        const paymentData = {
          amount: 19 * 100, //VALOR
          installmentType: 1, //A VISTA OU PARCELADO
          installments: 1, //PARCELAS
          type: 1, //TIPO DEBITO OU CREDITO OU VOUCHER
          userReference: 'PAGAMENTO', //REFERENCIA
          printReceipt: false //IMPRIMIR RECIBO
        };
        PlugPagService.doPayment(JSON.stringify(paymentData)).then((initResult) => {
          console.log("SUCESSO", initResult);
        }, error => {
          console.error('ERRO', error);
        });
      }
    }, error => {
      console.error('ERROR', error);
    });

  }
0.11.6

4 years ago

0.11.5

4 years ago

0.11.2

4 years ago

0.11.3

4 years ago

0.11.4

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.14

4 years ago

0.10.15

4 years ago

0.10.13

4 years ago

0.10.11

4 years ago

0.10.12

4 years ago

0.10.10

4 years ago

0.10.9

4 years ago

0.10.8

4 years ago

0.10.5

4 years ago

0.10.6

4 years ago

0.10.7

4 years ago

0.10.1

4 years ago

0.10.2

4 years ago

0.10.3

4 years ago

0.10.4

4 years ago

0.10.0

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.9

4 years ago

0.8.8

4 years ago

0.8.7

4 years ago

0.8.6

5 years ago

0.8.5

5 years ago

0.8.4

5 years ago

0.8.3

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago