WePay.userCallback()

Add callback_uri to user.

If you add a callback_uri you will receive IPNs with the user_id each time the user revokes their access_token or is deleted.

Usage

Hover over inputs/exits for more info.

var WePay = require('machinepack-wepay');


// Add callback_uri to user.

WePay.userCallback({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

callbackUri: 'https://www.wepay.com/ipn/12345',

useProduction: false,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessToken required

The string access token of the user you want IPNs for.

'604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184'
callbackUri required

The callback_uri you want to receive IPNs on. Must be a full URI.

'https://www.wepay.com/ipn/12345'
useProduction

Use WePay production API - payments will be charged. Defaults to WePay staging - payments are not charged.

false

Exits

error

An unexpected error occurred.

success

OK.

{ user_id: 12345,
  first_name: 'Bill',
  last_name: 'Clerico',
  email: 'api@wepay.com',
  state: 'registered',
  callback_uri: 'https://www.everribbon.com/ipn/12345' }