{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/support-frontend/pulls/comments/225962950","pull_request_review_id":165672818,"id":225962950,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTk2Mjk1MA==","diff_hunk":"@@ -23,12 +25,38 @@ function initialisePaymentMethod(state: State, dispatch: Dispatch<Action>) {\n   dispatch(updatePaymentMethod(paymentMethodToSelect));\n }\n \n+function initialiseStripeCheckout(onPaymentAuthorisation, contributionType, currencyId, isTestUser, dispatch) {\n+\n+  setupStripeCheckout(onPaymentAuthorisation, contributionType, currencyId, isTestUser)\n+    .then((handler: PaymentHandler) => dispatch(isPaymentReady(true, { [contributionType]: { Stripe: handler } })));\n+}\n+\n+function initialisePaymentMethods(state: State, dispatch: Function) {\n+  const { countryId } = state.common.internationalisation;","path":"assets/pages/new-contributions-landing/contributionsLandingInit.js","position":40,"original_position":36,"commit_id":"199e50c18e01edfc0447b71b594df4ccca96aaaf","original_commit_id":"6384fe8b0cc321e34b03a314de51810faadc11bd","user":{"login":"tsop14","id":8484757,"node_id":"MDQ6VXNlcjg0ODQ3NTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8484757?v=4","gravatar_id":"","url":"https://api.github.com/users/tsop14","html_url":"https://github.com/tsop14","followers_url":"https://api.github.com/users/tsop14/followers","following_url":"https://api.github.com/users/tsop14/following{/other_user}","gists_url":"https://api.github.com/users/tsop14/gists{/gist_id}","starred_url":"https://api.github.com/users/tsop14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsop14/subscriptions","organizations_url":"https://api.github.com/users/tsop14/orgs","repos_url":"https://api.github.com/users/tsop14/repos","events_url":"https://api.github.com/users/tsop14/events{/privacy}","received_events_url":"https://api.github.com/users/tsop14/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-10-17T14:48:48Z","updated_at":"2018-10-17T14:48:48Z","html_url":"https://github.com/guardian/support-frontend/pull/1047#discussion_r225962950","pull_request_url":"https://api.github.com/repos/guardian/support-frontend/pulls/1047","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/comments/225962950"},"html":{"href":"https://github.com/guardian/support-frontend/pull/1047#discussion_r225962950"},"pull_request":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/1047"}},"in_reply_to_id":225955961},"pull_request":{"url":"https://api.github.com/repos/guardian/support-frontend/pulls/1047","id":223617972,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjE3OTcy","html_url":"https://github.com/guardian/support-frontend/pull/1047","diff_url":"https://github.com/guardian/support-frontend/pull/1047.diff","patch_url":"https://github.com/guardian/support-frontend/pull/1047.patch","issue_url":"https://api.github.com/repos/guardian/support-frontend/issues/1047","number":1047,"state":"open","locked":false,"title":"initialise third party payment libraries","user":{"login":"tsop14","id":8484757,"node_id":"MDQ6VXNlcjg0ODQ3NTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8484757?v=4","gravatar_id":"","url":"https://api.github.com/users/tsop14","html_url":"https://github.com/tsop14","followers_url":"https://api.github.com/users/tsop14/followers","following_url":"https://api.github.com/users/tsop14/following{/other_user}","gists_url":"https://api.github.com/users/tsop14/gists{/gist_id}","starred_url":"https://api.github.com/users/tsop14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsop14/subscriptions","organizations_url":"https://api.github.com/users/tsop14/orgs","repos_url":"https://api.github.com/users/tsop14/repos","events_url":"https://api.github.com/users/tsop14/events{/privacy}","received_events_url":"https://api.github.com/users/tsop14/received_events","type":"User","site_admin":false},"body":"## Why are you doing this?\r\nSo the NPF works for Stripe one-off. \r\n<!--\r\nRemember, PRs are documentation for future contributors.\r\n\r\nIf this PR is a fix, please include a link to the original PR that introduced\r\nthe breakage for reference.\r\n-->\r\n\r\n[**Trello Card**](https://trello.com/c/41e5ijeC/76-npf-stripe-does-not-switch-between-recurring-one-off-keys-when-changing-tabs-this-means-stripe-one-off-is-broken)\r\n\r\n## Changes\r\n\r\n* Renames `paymentHandlers` to `thirdPartyPaymentLibraries` because that is what they are! \r\n* Adds extra dimension to thirdPartyPaymentLibraries as Stripe one-off is different from recurring. Uses PaymentMatrix to ensure all combinations are covered! \r\n* Moves initialization of these libraries out of the render function and in to `contributionsLandingInit`.\r\n* Initialises all libraries on page load (rather than when the tab / payment option is selected)\r\n* No longer initialises with the matrix as the majority of combinations did not require action, instead uses a humble if statement to initialise stripe checkout. \r\n\r\n","created_at":"2018-10-17T14:05:38Z","updated_at":"2018-10-17T14:48:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bb153533424d146ecb66b6603ca810b23ea2952","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/support-frontend/pulls/1047/commits","review_comments_url":"https://api.github.com/repos/guardian/support-frontend/pulls/1047/comments","review_comment_url":"https://api.github.com/repos/guardian/support-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/support-frontend/issues/1047/comments","statuses_url":"https://api.github.com/repos/guardian/support-frontend/statuses/199e50c18e01edfc0447b71b594df4ccca96aaaf","head":{"label":"guardian:em-stripe-key","ref":"em-stripe-key","sha":"199e50c18e01edfc0447b71b594df4ccca96aaaf","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":87204582,"node_id":"MDEwOlJlcG9zaXRvcnk4NzIwNDU4Mg==","name":"support-frontend","full_name":"guardian/support-frontend","private":false,"owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/guardian/support-frontend","description":"Frontend for the Supporter platform","fork":false,"url":"https://api.github.com/repos/guardian/support-frontend","forks_url":"https://api.github.com/repos/guardian/support-frontend/forks","keys_url":"https://api.github.com/repos/guardian/support-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/support-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/support-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/support-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/support-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/support-frontend/events","assignees_url":"https://api.github.com/repos/guardian/support-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/support-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/support-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/support-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/support-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/support-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/support-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/support-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/support-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/support-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/support-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/support-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/support-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/support-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/support-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/support-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/support-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/support-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/support-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/support-frontend/merges","archive_url":"https://api.github.com/repos/guardian/support-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/support-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/support-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/support-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/support-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/support-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/support-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/support-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/support-frontend/deployments","created_at":"2017-04-04T15:37:12Z","updated_at":"2018-10-17T14:18:15Z","pushed_at":"2018-10-17T14:42:21Z","git_url":"git://github.com/guardian/support-frontend.git","ssh_url":"git@github.com:guardian/support-frontend.git","clone_url":"https://github.com/guardian/support-frontend.git","svn_url":"https://github.com/guardian/support-frontend","homepage":"https://support.theguardian.com/","size":6891,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":7,"watchers":4,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"e852790a6fd2f0ba49b694caf67f728abe64f032","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":87204582,"node_id":"MDEwOlJlcG9zaXRvcnk4NzIwNDU4Mg==","name":"support-frontend","full_name":"guardian/support-frontend","private":false,"owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/guardian/support-frontend","description":"Frontend for the Supporter platform","fork":false,"url":"https://api.github.com/repos/guardian/support-frontend","forks_url":"https://api.github.com/repos/guardian/support-frontend/forks","keys_url":"https://api.github.com/repos/guardian/support-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/support-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/support-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/support-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/support-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/support-frontend/events","assignees_url":"https://api.github.com/repos/guardian/support-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/support-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/support-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/support-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/support-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/support-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/support-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/support-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/support-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/support-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/support-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/support-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/support-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/support-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/support-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/support-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/support-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/support-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/support-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/support-frontend/merges","archive_url":"https://api.github.com/repos/guardian/support-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/support-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/support-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/support-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/support-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/support-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/support-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/support-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/support-frontend/deployments","created_at":"2017-04-04T15:37:12Z","updated_at":"2018-10-17T14:18:15Z","pushed_at":"2018-10-17T14:42:21Z","git_url":"git://github.com/guardian/support-frontend.git","ssh_url":"git@github.com:guardian/support-frontend.git","clone_url":"https://github.com/guardian/support-frontend.git","svn_url":"https://github.com/guardian/support-frontend","homepage":"https://support.theguardian.com/","size":6891,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/1047"},"html":{"href":"https://github.com/guardian/support-frontend/pull/1047"},"issue":{"href":"https://api.github.com/repos/guardian/support-frontend/issues/1047"},"comments":{"href":"https://api.github.com/repos/guardian/support-frontend/issues/1047/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/1047/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/1047/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/support-frontend/statuses/199e50c18e01edfc0447b71b594df4ccca96aaaf"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tsop14"}}