Giter VIP home page Giter VIP logo

nodejs_server_example_create_payment_izipay's Introduction

Nodejs Server Example - Create Izipay payment

Server example in nodejs to create and validate the payment result of the Izipay payment provider

Requirements

  • Nodejs 18.15
  • Izipay REST API authentication keys

Setting

  1. Rename the example.env file to .env
  2. configure .envenvironment variables
ID_TIENDA=44532503

CLAVE_TEST=AN7sPAUn19UQ1cXL
CLAVE_PRODUCCION=

PASSWORD_TEST=testpassword_x0ZDVlzhOnkCMiSGpOQ9rLbQUlKYmunHSfI5SN54avffE
PASSWORD_PRODUCCION=

PUBLIC_KEY_TEST=44532503:testpublickey_csSdGM0KnIzIy0hYRj29NoDYjBKV6uDAfP42sIonUhG7u
PUBLIC_KEY_PRODUCCION=

CLAVE_HMAC_SHA_256_TEST=WLYdcwRkqenw7j9hgKmZU4yhQ91gnqQ36S95YwBh7ByE8
CLAVE_HMAC_SHA_256_PRODUCCION=

MODE=TEST
  1. Instalar dependencias npm install
  2. Ejecutar servidor local npm run start:dev

Guia

Este proyecto contiene 3 servicios APIREST creados

  1. http://localhost:3000/api/createPayment => Endpoint para generar el formToken necesario y motrar el formulario de pago.
  2. http://localhost:3000/api/validatePayment => Endpoint que realizará la valicación de un pago exitoso.
  3. http://localhost:3000/api/ipn => Endpoint para recibir la notificación de pago instantáneo(IPN)

CreatePayment

POST: Crear FormToken
http://localhost:3000/api/createPayment
HEADERS ``

`` BODY: json

{
    amount: 5,
    currency: USD,
    customer: {
        email: "[email protected]",
        ...
    },
    orderId: pedido-123,
    ...
}

ValidatePayment

POST: Verificar pago realizado http://localhost:3000/api/validatePayment
BODY: json

{
    hash: "saw1c3x1c31c1sfdfae78ada8s7dasd6as6d7d7as6",
    hashKey: "sha256_hmac",
    hashAlgorith: "sha256_hmac"
    clientAnswer:{SHOPID:12345678,ORDERSTATUS:PAID,...}
}

IPN

POST: Recibir notificación de pago instantáneo(IPN)

{
    hash: "saw1c3x1c31c1sfdfae78ada8s7dasd6as6d7d7as6",
    hashKey: "password",
    hashAlgorith: "sha256_hmac"
    clientAnswer:{SHOPID:12345678,ORDERSTATUS:PAID,...}
}

Para más información acerca del formulario de Izipay consulte su documentación Aquí

nodejs_server_example_create_payment_izipay's People

Contributors

jersongerman avatar izipay-pe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.