Skip to content

Commit

Permalink
Add tempCustomerId and trackLogout func
Browse files Browse the repository at this point in the history
  • Loading branch information
sHesl committed Jul 18, 2018
1 parent cb450c0 commit 2c6f505
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion ravelin.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,15 @@
this._ravelin(['trackPage'].concat(Array.prototype.slice.call(arguments, 0)));
}

/**
* trackLogout informs Ravelin of logout events and resets the associated customerId and tempCustomerId.
*
* @param {Object} meta Any additional metadata you wish to use to describe the event.
*/
RavelinJS.prototype.trackLogout = function() {
this._ravelin(['trackLogout'].concat(Array.prototype.slice.call(arguments, 0)));
}

/**
* trackFingerprint sends device information back to Ravelin. Invoke from
* the checkout page of your payment flow.
Expand Down Expand Up @@ -962,10 +971,20 @@
* @param {String} customerId
*/
RavelinJS.prototype.setCustomerId = function() {
console.info('what?')
this._ravelin(['setCustomerId'].concat(Array.prototype.slice.call(arguments, 0)));
}

/**
* Set the tempCustomerId submitted with requests. This is used as a temporary association between device/
* session data and a user, and should be followed with a v2/login request to Ravelin as soon as a
* customerId is available
*
* @param {String} customerId
*/
RavelinJS.prototype.setTempCustomerId = function() {
this._ravelin(['setTempCustomerId'].concat(Array.prototype.slice.call(arguments, 0)));
}

/**
* Set the orderId submitted with requests. This is used to associate session-activity
* with a specific user.
Expand Down

0 comments on commit 2c6f505

Please sign in to comment.