0.1.4 • Published 7 years ago

flav-payline v0.1.4

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

Payline

Fork of cubyn/payline

I choose to refine the package entirely.

Usage

Where to find those f**** config strings? Well I've been there:

  • userId is sent by email when you subscribe to Payline. joyfully named Vendor identifier or Merchant's Login elsewhere in their admin
  • userPass is called access key and available in Settings > Change your access key
  • url wsdl is working now!
npm install flav-payline
var Payline = require('flav-payline');
var payline = new Payline('<% userId %>', '<% userPass %>', '<% url wsdl (optional) %>');

Example using doWebPayment

payline.runAction('doWebPayment', {
    payment: {
    attributes: {
      xsi_type: {
          type: "payment"
          xmlns: "http://obj.ws.payline.experian.com"
        }
      },
      amount: 123,
      currency: 978,
      action: 101,
      mode: "CPT",
      contractNumber: "1234567"
     },
     returnURL: "https://google.com",
     cancelURL: "http://google.com",
     order: {
      ref: "1576576",
      amount: 123,
      currency: 978,
      date: "20/06/2015 20:21"
     },
     selectedContractList: null,
     buyer: {}
   })
   .then(function (result) {
     console.log("Youpla! Redirect to: " + result.redirectURL);
   })
   .catch(err => {
     console.log("Wtf happened: " + err.shortMessage + ' - ' + err.longMessage);
   });

API

new Payline(userId, userPass) -> instance

See Usage to find those variables You can override the wsdl bundled in this module by setting a 3th arg : new Payline(userId, userPass, 'my file path or url')

instance.runAction(doWebPayment, object) -> Promise(object)

Use the method describe to see wich methods is available with your wsdl.

instance.describe() -> Promise(string)
0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago