{"action":"closed","number":630,"pull_request":{"url":"https://api.github.com/repos/guardian/support-frontend/pulls/630","id":183773058,"html_url":"https://github.com/guardian/support-frontend/pull/630","diff_url":"https://github.com/guardian/support-frontend/pull/630.diff","patch_url":"https://github.com/guardian/support-frontend/pull/630.patch","issue_url":"https://api.github.com/repos/guardian/support-frontend/issues/630","number":630,"state":"closed","locked":false,"title":"Review Checkout Defaults","user":{"login":"Ap0c","id":5131341,"avatar_url":"https://avatars3.githubusercontent.com/u/5131341?v=4","gravatar_id":"","url":"https://api.github.com/users/Ap0c","html_url":"https://github.com/Ap0c","followers_url":"https://api.github.com/users/Ap0c/followers","following_url":"https://api.github.com/users/Ap0c/following{/other_user}","gists_url":"https://api.github.com/users/Ap0c/gists{/gist_id}","starred_url":"https://api.github.com/users/Ap0c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ap0c/subscriptions","organizations_url":"https://api.github.com/users/Ap0c/orgs","repos_url":"https://api.github.com/users/Ap0c/repos","events_url":"https://api.github.com/users/Ap0c/events{/privacy}","received_events_url":"https://api.github.com/users/Ap0c/received_events","type":"User","site_admin":false},"body":"# Why are you doing this?\r\n\r\nThis PR covers two issues:\r\n\r\n1. We have two very similar functions for parsing contributions:\r\n  - `parse`, which is used on the checkouts.\r\n  - `circlesParse`, which is used on the landing pages.\r\n2. If a user arrives on the checkout without a contribution value set, they will be defaulted to an amount that may be higher than their original choice.\r\n\r\nThe proposed solutions are as follows:\r\n\r\n1. Share parsing functionality between the checkouts and the landing pages. The result is actually still two functions, but they now do different things, rather than the same thing in different ways:\r\n- `parseContribution`, which reads a contribution from a string and converts it to a monetary value.\r\n- `validateContribution`, which checks that a contribution is within the accepted limits.\r\n2. Get the checkouts to default to the minimum accepted contribution value.\r\n\r\ncc @JustinPinner \r\n\r\n[**Trello Card**](https://trello.com/c/cXZi3pkn/1336-review-checkout-defaults)\r\n\r\n# Changes\r\n\r\n- Deleted the old `parse` and `circlesParse` functions.\r\n- Added `parseContribution`, `validateContribution` and `getMinContribution`.\r\n- Created a new, shared `checkouts` helper to manage functionality common to both checkouts.\r\n- Updated and added further tests.\r\n","created_at":"2018-04-24T15:18:14Z","updated_at":"2018-04-30T13:58:54Z","closed_at":"2018-04-30T13:58:54Z","merged_at":"2018-04-30T13:58:53Z","merge_commit_sha":"f3e3b6938aa4ff71ce74819de386fad99dcd3370","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rupertbates","id":181371,"avatar_url":"https://avatars2.githubusercontent.com/u/181371?v=4","gravatar_id":"","url":"https://api.github.com/users/rupertbates","html_url":"https://github.com/rupertbates","followers_url":"https://api.github.com/users/rupertbates/followers","following_url":"https://api.github.com/users/rupertbates/following{/other_user}","gists_url":"https://api.github.com/users/rupertbates/gists{/gist_id}","starred_url":"https://api.github.com/users/rupertbates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupertbates/subscriptions","organizations_url":"https://api.github.com/users/rupertbates/orgs","repos_url":"https://api.github.com/users/rupertbates/repos","events_url":"https://api.github.com/users/rupertbates/events{/privacy}","received_events_url":"https://api.github.com/users/rupertbates/received_events","type":"User","site_admin":false},{"login":"davidfurey","id":2619836,"avatar_url":"https://avatars0.githubusercontent.com/u/2619836?v=4","gravatar_id":"","url":"https://api.github.com/users/davidfurey","html_url":"https://github.com/davidfurey","followers_url":"https://api.github.com/users/davidfurey/followers","following_url":"https://api.github.com/users/davidfurey/following{/other_user}","gists_url":"https://api.github.com/users/davidfurey/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfurey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfurey/subscriptions","organizations_url":"https://api.github.com/users/davidfurey/orgs","repos_url":"https://api.github.com/users/davidfurey/repos","events_url":"https://api.github.com/users/davidfurey/events{/privacy}","received_events_url":"https://api.github.com/users/davidfurey/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/support-frontend/pulls/630/commits","review_comments_url":"https://api.github.com/repos/guardian/support-frontend/pulls/630/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/630/comments","statuses_url":"https://api.github.com/repos/guardian/support-frontend/statuses/d7a1f1a24e6a738983f24783deaa0b07a073285a","head":{"label":"guardian:review-checkout-defaults","ref":"review-checkout-defaults","sha":"d7a1f1a24e6a738983f24783deaa0b07a073285a","user":{"login":"guardian","id":164318,"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,"name":"support-frontend","full_name":"guardian/support-frontend","owner":{"login":"guardian","id":164318,"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},"private":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-04-27T13:46:09Z","pushed_at":"2018-04-30T13:58:53Z","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":4210,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"7a062cc8ee88b48e7887a2d0604cabe9e547a099","user":{"login":"guardian","id":164318,"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,"name":"support-frontend","full_name":"guardian/support-frontend","owner":{"login":"guardian","id":164318,"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},"private":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-04-27T13:46:09Z","pushed_at":"2018-04-30T13:58:53Z","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":4210,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/630"},"html":{"href":"https://github.com/guardian/support-frontend/pull/630"},"issue":{"href":"https://api.github.com/repos/guardian/support-frontend/issues/630"},"comments":{"href":"https://api.github.com/repos/guardian/support-frontend/issues/630/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/support-frontend/pulls/630/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/630/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/support-frontend/statuses/d7a1f1a24e6a738983f24783deaa0b07a073285a"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"Ap0c","id":5131341,"avatar_url":"https://avatars3.githubusercontent.com/u/5131341?v=4","gravatar_id":"","url":"https://api.github.com/users/Ap0c","html_url":"https://github.com/Ap0c","followers_url":"https://api.github.com/users/Ap0c/followers","following_url":"https://api.github.com/users/Ap0c/following{/other_user}","gists_url":"https://api.github.com/users/Ap0c/gists{/gist_id}","starred_url":"https://api.github.com/users/Ap0c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ap0c/subscriptions","organizations_url":"https://api.github.com/users/Ap0c/orgs","repos_url":"https://api.github.com/users/Ap0c/repos","events_url":"https://api.github.com/users/Ap0c/events{/privacy}","received_events_url":"https://api.github.com/users/Ap0c/received_events","type":"User","site_admin":false},"comments":0,"review_comments":2,"maintainer_can_modify":false,"commits":13,"additions":203,"deletions":83,"changed_files":11}}
{"actor":{"display_login":"Ap0c"}}