Giter Site home page Giter Site logo

node-kpf's Introduction

KitPagoFlow.js

Kit de pago Flow para NodeJS version >= 8.0 de tipo funcional y modular

Uso

const BASE_URL = 'https://mi-url.cl';
const FlowApi = require('./src');
const { new_order, read_confirm, read_result, build_response } = FlowApi({
  FLOW_URL_EXITO: `${BASE_URL}/api/reservas/pago-exito`,
  FLOW_URL_FRACASO: `${BASE_URL}/api/reservas/pago-fracaso`,
  FLOW_URL_CONFIRMACION: `${BASE_URL}/api/reservas/pago-confirmacion`,
  FLOW_URL_RETORNO: BASE_URL,
  FLOW_URL_PAGO: 'http://flow.tuxpan.com/app/kpf/pago.php',
  FLOW_KEY: path.join(__dirname, '/keys'),
  FLOW_LOGPATH: path.join(__dirname, '/logs'),
  FLOW_COMERCIO: '[email protected]',
});

Para Generar una nueva orden se usa new_order, que recibe un objeto con la información del pedido

const order = new_order({
  orden_compra: pedidoID,
  monto: 99999,
  concepto: `Pago pedido: ${pedidoID}`,
  email_pagador: '[email protected]',
});

Luego se debe enviar por metodo POST a la url definida en FLOW_URL_PAGO la string formada en order

<form method="post" action="[FLOW_URL_PAGO]">
  <input type="hidden" name="parameters" value="[order]">
  <button type="submit">Pagar Ya!</button>
</form>

Para mayor informacion acerca del uso de Flow: Api Flow

API armada en base a los trabajos realizados por EstebanFuentealba y Nabor, pero con un enfoque mas funcional

node-kpf's People

Contributors

miloplacencia avatar nabor avatar

Watchers

 avatar  avatar  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.