Skip to content

Commit 2793253

Browse files
authored
Merge pull request #961 from mozilla/payment-pages-react
feat(payments): initial rough payment pages
2 parents fa2fa7a + e2bea87 commit 2793253

File tree

35 files changed

+3657
-405
lines changed

35 files changed

+3657
-405
lines changed

packages/fxa-auth-server/config/dev.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@
5959
"interval": "month",
6060
"amount": 50,
6161
"currency": "usd"
62+
},
63+
{
64+
"plan_id": "321doneProWeekly",
65+
"product_id": "321doneProProduct",
66+
"interval": "week",
67+
"amount": 5,
68+
"currency": "usd"
69+
},
70+
{
71+
"plan_id": "allDoneProWeekly",
72+
"product_id": "allDoneProProduct",
73+
"interval": "week",
74+
"amount": 5,
75+
"currency": "usd"
6276
}
6377
]
6478
}

packages/fxa-content-server/app/scripts/views/settings/subscription.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const View = FormView.extend({
3838
ttl: managementTokenTTL,
3939
})
4040
.then((accessToken) => {
41-
const url = `${managementUrl}/#accessToken=${encodeURIComponent(accessToken.get('token'))}`;
41+
const url = `${managementUrl}/subscriptions#accessToken=${encodeURIComponent(accessToken.get('token'))}`;
4242
this.navigateAway(url);
4343
});
4444
}

packages/fxa-content-server/app/tests/spec/views/settings/subscription.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ describe('views/settings/subscription', function () {
7474
client_id: config.subscriptions.managementClientId,
7575
ttl: config.subscriptions.managementTokenTTL
7676
}
77-
]
77+
],
78+
'should make the correct call to account.createOAuthToken'
7879
);
7980
assert.deepEqual(
8081
view.navigateAway.args[0],
81-
[ `${config.subscriptions.managementUrl}/#accessToken=MOCK_TOKEN` ]
82+
[ `${config.subscriptions.managementUrl}/subscriptions#accessToken=MOCK_TOKEN` ],
83+
'should make the correct call to navigateAway'
8284
);
8385
});
8486
});

packages/fxa-payments-server/.eslintrc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
plugins:
22
- fxa
33
- sorting
4-
extends: plugin:fxa/client
4+
5+
extends:
6+
- plugin:fxa/client
7+
- plugin:react/recommended
58

69
# Required for `import( )` webpack feature
710
parser: babel-eslint
811

12+
settings:
13+
react:
14+
version: detect
15+
916
rules:
1017
brace-style: 2
1118
handle-callback-err: 0
@@ -17,7 +24,8 @@ rules:
1724
no-console: 0
1825
no-multi-str: 2
1926
no-useless-escape: 0
27+
"react/prop-types": 0
2028
sorting/sort-object-props: [ 2, { "ignoreCase": true, "ignoreMethods": true, "ignoreMethodSiblings": true, "ignorePrivate": true } ]
2129
space-infix-ops: 2
2230
space-unary-ops: [2, {"nonwords": false, "overrides": {"~": true, "!": true}}]
23-
strict: 0
31+
strict: 0
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*~
2-
3-
# react output
42
build/
3+
.nyc_output/
4+
coverage/
5+

0 commit comments

Comments
 (0)