komola / paymill-node

Node.JS wrapper for the Paymill v2 API
MIT License
24 stars 11 forks source link

Create Subscription issue. #21

Open CrackerakiUA opened 8 years ago

CrackerakiUA commented 8 years ago

I have issues couple of functions and now i need to create subscription, i am getting error:

{ Error: interval,currency,amount
    at IncomingMessage.<anonymous> (C:\Work\UpWork\Indrek Pihor\SmartManage\node_modules\paymill-node\lib\main.js:97:21)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  response:
   { exception: 'Api_Exception_InvalidParameter',
     error: 'interval,currency,amount' } }

Code i am using:

paymill.subscriptions.create({
  client: clients.data[0].id,
  payment: payment.data.id,
  interval: 'MONTH',
  currency: 'EUR',
  amount: '1000'
}, function(err, subscription) {
  console.log('err');
  console.log(err);
  console.log('subscription');
  console.log(subscription);
  // if(err) callback(false);
  // else callback(subscription.data);
});

Object which is passing to create function:

{ client: 'client_e37a84dc81e810e54ea9',
  payment: 'pay_3b4aee5a016ca07ff739b4c6',
  interval: 'MONTH',
  currency: 'EUR',
  amount: 1000 }
thomaschaaf commented 8 years ago

Please try https://github.com/paymill/paymill-js I am not using payroll anymore. Sorry.