{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/176706821","pull_request_review_id":106455913,"id":176706821,"diff_hunk":"@@ -0,0 +1,58 @@\n+/** @format */\n+\n+/**\n+ * Internal dependencies\n+ */\n+import {\n+\tBILLING_TRANSACTION_REQUEST,\n+\tBILLING_TRANSACTION_REQUEST_FAILURE,\n+\tBILLING_TRANSACTION_REQUEST_SUCCESS,\n+} from 'state/action-types';\n+import { combineReducers, createReducer, keyedReducer } from 'state/utils';\n+\n+/**\n+ * Returns the updated requests state after an action has been dispatched.\n+ * The state is a Boolean - true if a transaction is being requested\n+ *\n+ * @param  {Object} state  Current state\n+ * @param  {Object} action Action payload\n+ * @return {Object}        Updated state\n+ */\n+export const requesting = createReducer( false, {\n+\t[ BILLING_TRANSACTION_REQUEST ]: () => true,\n+\t[ BILLING_TRANSACTION_REQUEST_FAILURE ]: () => false,\n+\t[ BILLING_TRANSACTION_REQUEST_SUCCESS ]: () => false,\n+} );\n+\n+/**\n+ * Returns the updated error state after an action has been dispatched.\n+ * The state is a Boolean - true if a transaction request has failed\n+ *\n+ * @param  {Object} state  Current state\n+ * @param  {Object} action Action payload\n+ * @return {Object}        Updated state\n+ */\n+export const error = createReducer( false, {\n+\t[ BILLING_TRANSACTION_REQUEST_FAILURE ]: ( state, action ) => Boolean( action.error ),\n+} );\n+\n+/**\n+ * Returns the updated data state after an action has been dispatched.\n+ * The state contains the transaction data after a successful fetch\n+ *\n+ * @param  {Object} state  Current state\n+ * @param  {Object} action Action payload\n+ * @return {Object}        Updated state\n+ */\n+export const data = createReducer( null, {\n+\t[ BILLING_TRANSACTION_REQUEST_SUCCESS ]: ( state, { receipt } ) => receipt,","path":"client/state/billing-transactions/individual-transactions/reducer.js","position":48,"original_position":48,"commit_id":"f2902a144380f74f504a877352669c33a02c05e8","original_commit_id":"f2902a144380f74f504a877352669c33a02c05e8","user":{"login":"tyxla","id":8436925,"avatar_url":"https://avatars2.githubusercontent.com/u/8436925?v=4","gravatar_id":"","url":"https://api.github.com/users/tyxla","html_url":"https://github.com/tyxla","followers_url":"https://api.github.com/users/tyxla/followers","following_url":"https://api.github.com/users/tyxla/following{/other_user}","gists_url":"https://api.github.com/users/tyxla/gists{/gist_id}","starred_url":"https://api.github.com/users/tyxla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyxla/subscriptions","organizations_url":"https://api.github.com/users/tyxla/orgs","repos_url":"https://api.github.com/users/tyxla/repos","events_url":"https://api.github.com/users/tyxla/events{/privacy}","received_events_url":"https://api.github.com/users/tyxla/received_events","type":"User","site_admin":false},"body":"Should a successful request for a transaction also clear any errors that were previously stored for that transaction?","created_at":"2018-03-23T11:26:22Z","updated_at":"2018-03-23T11:40:21Z","html_url":"https://github.com/Automattic/wp-calypso/pull/23497#discussion_r176706821","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/176706821"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23497#discussion_r176706821"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497","id":176464752,"html_url":"https://github.com/Automattic/wp-calypso/pull/23497","diff_url":"https://github.com/Automattic/wp-calypso/pull/23497.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/23497.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23497","number":23497,"state":"open","locked":false,"title":"Individual receipts - support fetching single receipts","user":{"login":"marcinbot","id":800604,"avatar_url":"https://avatars1.githubusercontent.com/u/800604?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinbot","html_url":"https://github.com/marcinbot","followers_url":"https://api.github.com/users/marcinbot/followers","following_url":"https://api.github.com/users/marcinbot/following{/other_user}","gists_url":"https://api.github.com/users/marcinbot/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinbot/subscriptions","organizations_url":"https://api.github.com/users/marcinbot/orgs","repos_url":"https://api.github.com/users/marcinbot/repos","events_url":"https://api.github.com/users/marcinbot/events{/privacy}","received_events_url":"https://api.github.com/users/marcinbot/received_events","type":"User","site_admin":false},"body":"Adds actions, reducer and a wpcom lib extension ported from #22442\r\n\r\nNow with Jest tests \r\n\r\nTest instructions:\r\n* unit tests should pass and the code should have no issues\r\n* #23500 puts all the individual receipts PRs together - the specifications listed there should be met","created_at":"2018-03-21T12:47:12Z","updated_at":"2018-03-23T11:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48103e0ff3610d9408b37d72fd5c8101a1d156e2","assignee":{"login":"marcinbot","id":800604,"avatar_url":"https://avatars1.githubusercontent.com/u/800604?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinbot","html_url":"https://github.com/marcinbot","followers_url":"https://api.github.com/users/marcinbot/followers","following_url":"https://api.github.com/users/marcinbot/following{/other_user}","gists_url":"https://api.github.com/users/marcinbot/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinbot/subscriptions","organizations_url":"https://api.github.com/users/marcinbot/orgs","repos_url":"https://api.github.com/users/marcinbot/repos","events_url":"https://api.github.com/users/marcinbot/events{/privacy}","received_events_url":"https://api.github.com/users/marcinbot/received_events","type":"User","site_admin":false},"assignees":[{"login":"marcinbot","id":800604,"avatar_url":"https://avatars1.githubusercontent.com/u/800604?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinbot","html_url":"https://github.com/marcinbot","followers_url":"https://api.github.com/users/marcinbot/followers","following_url":"https://api.github.com/users/marcinbot/following{/other_user}","gists_url":"https://api.github.com/users/marcinbot/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinbot/subscriptions","organizations_url":"https://api.github.com/users/marcinbot/orgs","repos_url":"https://api.github.com/users/marcinbot/repos","events_url":"https://api.github.com/users/marcinbot/events{/privacy}","received_events_url":"https://api.github.com/users/marcinbot/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"jeffstieler","id":63922,"avatar_url":"https://avatars3.githubusercontent.com/u/63922?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffstieler","html_url":"https://github.com/jeffstieler","followers_url":"https://api.github.com/users/jeffstieler/followers","following_url":"https://api.github.com/users/jeffstieler/following{/other_user}","gists_url":"https://api.github.com/users/jeffstieler/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffstieler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffstieler/subscriptions","organizations_url":"https://api.github.com/users/jeffstieler/orgs","repos_url":"https://api.github.com/users/jeffstieler/repos","events_url":"https://api.github.com/users/jeffstieler/events{/privacy}","received_events_url":"https://api.github.com/users/jeffstieler/received_events","type":"User","site_admin":false},{"login":"sirreal","id":841763,"avatar_url":"https://avatars2.githubusercontent.com/u/841763?v=4","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":289345365,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Purchases","name":"Purchases","color":"006b75","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23497/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/f2902a144380f74f504a877352669c33a02c05e8","head":{"label":"Automattic:add/individual-receipts-state","ref":"add/individual-receipts-state","sha":"f2902a144380f74f504a877352669c33a02c05e8","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-03-23T09:35:00Z","pushed_at":"2018-03-23T11:21:35Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":83170,"stargazers_count":9816,"watchers_count":9816,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1373,"mirror_url":null,"archived":false,"open_issues_count":1507,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1373,"open_issues":1507,"watchers":9816,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"37b89f4cc9e1514a4186a2796752831ce987766c","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-03-23T09:35:00Z","pushed_at":"2018-03-23T11:21:35Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":83170,"stargazers_count":9816,"watchers_count":9816,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1373,"mirror_url":null,"archived":false,"open_issues_count":1507,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1373,"open_issues":1507,"watchers":9816,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23497"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23497"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23497/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23497/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/f2902a144380f74f504a877352669c33a02c05e8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tyxla"}}