Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var router = express.Router();
- var khipu = require('fi-khipu');
- khipu.configure(CODE, '');
- khipu.config.sslVerification = false;
- /* GET home page. */
- router.get('/', function (req, res, next) {
- khipu.listBanks(function callback(err, banks) {
- if (err) {
- throw err;
- }
- res.render('index', { title: 'Express', banks: banks });
- });
- });
- router.post('/payment', function (req, res) {
- var payment = {
- subject: 'Payment test',
- amount: 10
- //...
- };
- khipu.createPayment(payment, function callback(err, payment) {
- if (err) {
- throw err;
- }
- console.log(payment)
- });
- });
- router.get('/payment', function (req, res) {
- khipu.getPaymentById('lnb3o2kexf8o', function (err, payment) {
- if (err) {
- throw err;
- }
- console.log(payment);
- });
- });
- router.get('/cancel_pay', function (req, res) {
- var paymentId = 'lnb3o2kexf8o';
- khipu.deletePayment(paymentId, function (err, payment) {
- if (err) {
- throw err;
- }
- console.log(payment)
- });
- });
- module.exports = router;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement