mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix(api): Pass in headers to payments analytics
This commit is contained in:
@@ -131,7 +131,11 @@ api.checkout = {
|
|||||||
|
|
||||||
// execute payment
|
// execute payment
|
||||||
let method = 'buyGems';
|
let method = 'buyGems';
|
||||||
let data = { user, paymentMethod: 'Amazon Payments' };
|
let data = {
|
||||||
|
user,
|
||||||
|
paymentMethod: 'Amazon Payments',
|
||||||
|
headers: req.headers,
|
||||||
|
};
|
||||||
|
|
||||||
if (gift) {
|
if (gift) {
|
||||||
if (gift.type === 'subscription') method = 'createSubscription';
|
if (gift.type === 'subscription') method = 'createSubscription';
|
||||||
@@ -247,6 +251,7 @@ api.subscribeCancel = {
|
|||||||
user,
|
user,
|
||||||
nextBill: moment(user.purchased.plan.lastBillingDate).add({ days: subscriptionLength }),
|
nextBill: moment(user.purchased.plan.lastBillingDate).add({ days: subscriptionLength }),
|
||||||
paymentMethod: 'Amazon Payments',
|
paymentMethod: 'Amazon Payments',
|
||||||
|
headers: req.headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (req.query.noRedirect) {
|
if (req.query.noRedirect) {
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ api.cancelSubscription = async function cancelSubscription (data) {
|
|||||||
gaCategory: 'commerce',
|
gaCategory: 'commerce',
|
||||||
gaLabel: data.paymentMethod,
|
gaLabel: data.paymentMethod,
|
||||||
paymentMethod: data.paymentMethod,
|
paymentMethod: data.paymentMethod,
|
||||||
|
headers: data.headers,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user