@@ -21,6 +21,13 @@ $(document).ready(function () {
2121 prod : 'https://accounts.firefox.com/subscriptions/products' ,
2222 } ;
2323
24+ const sp3URL = {
25+ local : 'http://localhost:3035/' ,
26+ dev : '' ,
27+ stage : 'https://payments-next.stage.fxa.nonprod.webservices.mozgcp.net/' ,
28+ prod : '' ,
29+ } ;
30+
2431 const contentURL = {
2532 local : 'http://localhost:3030/' ,
2633 dev : 'https://latest.dev.lcip.org/' ,
@@ -44,6 +51,12 @@ $(document).ready(function () {
4451 cad : 'price_1H8NoEBVqmGyQTMa5MtpqAUM' ,
4552 myr : 'price_1H8NpGBVqmGyQTMaA6Znyu7U' ,
4653 } ,
54+ sp3links : {
55+ 'sp3-1m' : '123donepro/monthly/landing' ,
56+ 'sp3-6m' : '123donepro/halfyearly/landing' ,
57+ 'sp3-12m' : '123donepro/yearly/landing' ,
58+ 'sp3-1m-gb' : 'en-GB/123donepro/monthly/landing' ,
59+ } ,
4760 } ,
4861 stage : {
4962 product : 'prod_FfiuDs9u11ESbD' ,
@@ -63,13 +76,17 @@ $(document).ready(function () {
6376 case '123done-latest.dev.lcip.org' :
6477 paymentConfig = {
6578 env : paymentURL . dev ,
79+ sp3Url : sp3URL . dev ,
80+ sp3links : subscriptionConfig . default . sp3links ,
6681 ...subscriptionConfig . default ,
6782 contentEnv : contentURL . dev ,
6883 } ;
6984 break ;
7085 case 'stage-123done.herokuapp.com' :
7186 paymentConfig = {
7287 env : paymentURL . stage ,
88+ sp3Url : sp3URL . stage ,
89+ sp3links : subscriptionConfig . default . sp3links ,
7390 ...subscriptionConfig . stage ,
7491 contentEnv : contentURL . stage ,
7592 pwdlessURL : pwdlessPaymentURL . stage ,
@@ -85,6 +102,7 @@ $(document).ready(function () {
85102 default :
86103 paymentConfig = {
87104 env : paymentURL . local ,
105+ sp3Url : sp3URL . local ,
88106 ...subscriptionConfig . default ,
89107 contentEnv : contentURL . local ,
90108 pwdlessURL : pwdlessPaymentURL . local ,
@@ -119,9 +137,12 @@ $(document).ready(function () {
119137 $ ( '.btn-subscribe, .btn-subscribe-rp-provided-flow-metrics' ) . each ( function (
120138 index
121139 ) {
122- const { env, plans, product } = paymentConfig ;
140+ const { env, plans, product, sp3Url , sp3links } = paymentConfig ;
123141 const currency = $ ( this ) . attr ( 'data-currency' ) ;
124- const currencyMappedURL = `${ env } ${ product } ?plan=${ plans [ currency ] } ` ;
142+ const sp3 = $ ( this ) . attr ( 'data-sp3' ) ;
143+ const currencyMappedURL = sp3
144+ ? `${ sp3Url } ${ sp3links [ sp3 ] } `
145+ : `${ env } ${ product } ?plan=${ plans [ currency ] } ` ;
125146 $ ( this ) . attr ( 'href' , currencyMappedURL ) ;
126147 } ) ;
127148 }
0 commit comments