mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-08 21:38:43 +00:00
fix(api): Pass in headers to payments analytics
This commit is contained in:
parent
977bafd2d1
commit
9223aecfbe
2 changed files with 7 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ api.cancelSubscription = async function cancelSubscription (data) {
|
|||
gaCategory: 'commerce',
|
||||
gaLabel: data.paymentMethod,
|
||||
paymentMethod: data.paymentMethod,
|
||||
headers: data.headers,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue