netpayjs-angular
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

NetpayjsAngular

Este es un proyecto desarrollado en Angular version 14 donde se adapto la herramienta de NetpayJS (Custom Checkout).

Instalar

npm i netpayjs-angular

Importar libreria

Agregar los siguientes fragmentos de codigo en el componente donde este importaria la libreria.

En component.html:

<div>
    <div id="netpay-form"></div>
    <netpayjs [apikey]="'Public Key'" [forms]="Formulario"></netpayjs>
</div>

En component.module.ts:

import { NetpayjsModule } from 'netpayjs-angular'

@NgModule({
  imports: [
    NetpayjsModule
  ]
})

En component.ts:

    export class AppComponent implements OnInit {
    form:any;
    noForm:any;

    constructor(){
        this.form = {
        id: 'netpay-form',
        succes: this.success,
        error: this.error,
        options: { title: "Pagos con tarjeta", submitText: "Continuar" },
        sandboxMode: true,
        }
        
        this.noForm = {
        succes: this.success,
        error: this.error,
        cardInformation: {
            cardNumber: 'Num. Tarjeta',
            expMonth: 'Mes',
            expYear: 'Año',
            cvv2: 'CVV',
            deviceFingerPrint: ''
        },
        sandboxMode: true,
        }
    }

    success(e:any) {
        console.log("Token created successfully");
        console.log(e); 
    }
    
    error(e:any) {
        console.log("Something went wrong!");
        console.log(e);
    }
    }

Package Sidebar

Install

npm i netpayjs-angular

Homepage

netpay.mx

Weekly Downloads

1

Version

0.0.11

License

MIT

Unpacked Size

292 kB

Total Files

18

Last publish

Collaborators

  • netpaymx