PaidUpScheduleConnect.calculatePrices()

Calculate prices for a product

Calculate prices for a product

Usage

Hover over inputs/exits for more info.

var PaidUpScheduleConnect = require('paidup-schedule-connect');


// Calculate prices for a product

PaidUpScheduleConnect.calculatePrices({

baseUrl: 'http://localhost:9006',

token: 'secret-word',

prices: [ { version: 'v2', type: 'card', capAmount: 625, description: 'some description', dateCharge: 'some string data description', originalPrice: 203, stripePercent: 2.9, stripeFlat: 0.3, stripeAchPercent: 2.9, stripeAchFlat: 0.3, paidUpFee: 5, paidUpFlat: 5, discount: 10, payProcessing: false, payCollecting: true } ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

baseUrl required

TDSchedule microservice url.

'http://localhost:9006'
token required

token for authentication.

'secret-word'
prices required

List of amount to calculate

[ { version: 'v2',
    type: 'card',
    capAmount: 625,
    description: 'some description',
    dateCharge: 'some string data description',
    originalPrice: 203,
    stripePercent: 2.9,
    stripeFlat: 0.3,
    stripeAchPercent: 2.9,
    stripeAchFlat: 0.3,
    paidUpFee: 5,
    paidUpFlat: 5,
    discount: 10,
    payProcessing: false,
    payCollecting: true } ]

Exits

error

An unexpected error occurred.

{ status: 500, message: '*' }
success

OK.

{ status: 200,
  body: 'some like this: {\n          prices: [{\n            version: \'v2\',\n            basePrice: 290,\n            description : \'some description\',\n            dateCharge : \'some date string\',\n            owedPrice: 343.44,\n            discount : 12,\n            originalPrice: 300,\n            totalFee: 43.44,\n            feePaidUp: 4.2,\n            feeStripe: 3.6\n          }]\n        }' }