PaidUpScheduleConnect.calculatePrice()

Calculate price for a product

Calculate price for a product

Usage

Hover over inputs/exits for more info.

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


// Calculate price for a product

PaidUpScheduleConnect.calculatePrice({

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

token: 'secret-word',

version: 'v2',

originalPrice: 200.23,

stripePercent: 2.9,

stripeFlat: 0.3,

stripeAchPercent: 2.9,

stripeAchFlat: 0.3,

paidUpFee: 5,

paidUpFlat: 5,

discount: 20,

payProcessing: false,

payCollecting: true,

type: 'bank',

capAmount: 456,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

baseUrl required

Url TDSchedule microservice..

'http://localhost:9006'
token required

secret word for autenticate microservice.

'secret-word'
version required

version of calculations.

'v2'
originalPrice required

Price base for calculate owed price.

200.23
stripePercent required

Percentage for calculate stripe fee.

2.9
stripeFlat required

Amount base to calcualte stripe fee.

0.3
stripeAchPercent required

Percentage for calculate stripe fee.

2.9
stripeAchFlat required

Amount base to calcualte stripe fee.

0.3
paidUpFee required

Percentage to calculate Paid Up Fee.

5
paidUpFlat required

Flat amount to calculate Paid Up Fee.

5
discount required

Percentage to discount at original price

20
payProcessing required

This parameter define if user pay stripe processing

false
payCollecting required

This parameter define if user pay PadUp processing

true
type

Type of entity.

'bank'
capAmount

Amount limit for choose a kind of calculation.

456

Exits

error

An unexpected error occurred.

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

OK.

{ status: 200,
  body: 'some like this: {\n          version: \'v2\',\n          basePrice: 290,\n          originalPrice: 300,\n          totalFee: 34,\n          feePaidUp: 4.2,\n          feeStripe: 3.6,\n          owedPrice: 343.44,\n          discount : 12\n        }' }