Merge pull request #2895 from overleaf/jel-groups-itm-content

Include itm_content in redirect to payment page

GitOrigin-RevId: 4dea2777ed9d1d4a45edbe29371971418681375d
This commit is contained in:
Jessica Lawshe 2020-06-11 10:24:38 -05:00 committed by Copybot
parent 7d98a82208
commit cc018357e1

View file

@ -285,7 +285,8 @@ App.controller('PlansController', function(
App.controller('GroupPlansModalPurchaseController', function(
$scope,
$modal,
$location
$location,
$httpParamSerializer
) {
$scope.options = {
plan_codes: [
@ -393,8 +394,17 @@ App.controller('GroupPlansModalPurchaseController', function(
$scope.recalculatePrice()
$scope.purchase = function() {
let { plan_code, size, usage, currency } = $scope.selected
plan_code = `group_${plan_code}_${size}_${usage}`
window.location = `/user/subscription/new?planCode=${plan_code}&currency=${currency}&itm_campaign=groups`
const { plan_code, size, usage, currency } = $scope.selected
const queryParams = {
planCode: `group_${plan_code}_${size}_${usage}`,
currency,
itm_campaign: 'groups'
}
if ($location.search().itm_content) {
queryParams.itm_content = $location.search().itm_content
}
window.location = `/user/subscription/new?${$httpParamSerializer(
queryParams
)}`
}
})