Skip to content

Commit 9ea00da

Browse files
committed
feat(123done): add links for sp3
Because: - 123Done Pro needs links to plans for SP3 checkout pages This commit: - Adds links to SP3 checkout for various 123Done Pro plans. Closes #FXA-11188
1 parent 5662041 commit 9ea00da

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

packages/123done/static/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@
102102
>Subscribe to Pro (RP flow metrics)</a
103103
>
104104
</div>
105+
<div>
106+
<a class="btn btn-persona btn-subscribe" data-sp3="sp3-1m">
107+
SP3 - Sub to Pro 1m
108+
</a>
109+
<a class="btn btn-persona btn-subscribe" data-sp3="sp3-6m">
110+
SP3 - Sub to Pro 6m
111+
</a>
112+
<a class="btn btn-persona btn-subscribe" data-sp3="sp3-12m">
113+
SP3 - Sub to Pro 12m
114+
</a>
115+
<a class="btn btn-persona btn-subscribe" data-sp3="sp3-1m-gb">
116+
SP3 - Sub to Pro 1m (EN GB)
117+
</a>
118+
</div>
105119
</div>
106120

107121
<div id="splash">

packages/123done/static/js/123done.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)