fix(api): Pass in headers to payments analytics

This commit is contained in:
Blade Barringer
2016-08-14 23:08:04 -05:00
parent 977bafd2d1
commit 9223aecfbe
2 changed files with 7 additions and 1 deletions

View File

@@ -131,7 +131,11 @@ api.checkout = {
// execute payment
let method = 'buyGems';
let data = { user, paymentMethod: 'Amazon Payments' };
let data = {
user,
paymentMethod: 'Amazon Payments',
headers: req.headers,
};
if (gift) {
if (gift.type === 'subscription') method = 'createSubscription';
@@ -247,6 +251,7 @@ api.subscribeCancel = {
user,
nextBill: moment(user.purchased.plan.lastBillingDate).add({ days: subscriptionLength }),
paymentMethod: 'Amazon Payments',
headers: req.headers,
});
if (req.query.noRedirect) {

View File

@@ -146,6 +146,7 @@ api.cancelSubscription = async function cancelSubscription (data) {
gaCategory: 'commerce',
gaLabel: data.paymentMethod,
paymentMethod: data.paymentMethod,
headers: data.headers,
});
};