{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/comments/88725093","pull_request_review_id":9292561,"id":88725093,"diff_hunk":"@@ -61,6 +61,8 @@ public function register_routes() {\n \tpublic function update_items( $request ) {\n \t\t$request_body = $request->get_body();\n \t\t$settings = json_decode( $request_body, true, WOOCOMMERCE_CONNECT_MAX_JSON_DECODE_DEPTH );\n+\t\t$this->settings_store->update_origin_address( $settings[ 'origin' ] );","path":"classes/class-wc-rest-connect-shipping-label-controller.php","position":4,"original_position":4,"commit_id":"91ff2cfe2c7160b61c4e8a8f763c525e4f820b71","original_commit_id":"91ff2cfe2c7160b61c4e8a8f763c525e4f820b71","user":{"login":"DanReyLop","id":1715800,"avatar_url":"https://avatars.githubusercontent.com/u/1715800?v=3","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false},"body":"Before:\r\n* Merchant enters his address.\r\n* Submit address for normalization.\r\n* Server returns normalized address, and **that** address is stored in the settings.\r\n* Merchant is a rebel and picks the un-normalized address anyway.\r\n* Merchant purchases a label.\r\n\r\nIn that case, the stored address would be the normalized one, even though the merchant explicitly selected the other one (as Kelly told me, it happens that sometimes the address normalization services give you an address that's plain wrong). The next time the merchant opens the Labels UI modal, the `Origin` step would be collapsed and with a ✔️ so he won't realise that the address is \"wrong\".\r\n\r\nIt's better to only store the address when the merchant is actually purchasing a label for that address. Not 100% related with this issue but I noticed that odd behaviour while implementing it.","created_at":"2016-11-18T19:39:52Z","updated_at":"2016-11-18T19:39:52Z","html_url":"https://github.com/Automattic/woocommerce-connect-client/pull/717#discussion_r88725093","pull_request_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717","_links":{"self":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/comments/88725093"},"html":{"href":"https://github.com/Automattic/woocommerce-connect-client/pull/717#discussion_r88725093"},"pull_request":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717","id":94193063,"html_url":"https://github.com/Automattic/woocommerce-connect-client/pull/717","diff_url":"https://github.com/Automattic/woocommerce-connect-client/pull/717.diff","patch_url":"https://github.com/Automattic/woocommerce-connect-client/pull/717.patch","issue_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/717","number":717,"state":"open","locked":false,"title":"Logic to auto-accept address normalizations if the response has a special flag","user":{"login":"DanReyLop","id":1715800,"avatar_url":"https://avatars.githubusercontent.com/u/1715800?v=3","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false},"body":"Fixes #600 \r\n\r\nThis PR is totally backwards and forwards-compatible, but you won't be able to test it properly without the `update/auto-accept-address-normalization` branch on the server.\r\n\r\nWhen sending an address to normalize to the server, if the response has the `is_trivial_normalization` property set to `true`, then the normalized address will be automatically accepted without user intervention. As its name indicates, that flag will be set when the changes made by the address normalizator were trivial, such as adding the `+4` portion to a ZIP code, or changing capitalization, or changing `street` to `st` for example.\r\n\r\nTo test:\r\n* Go purchase a label.\r\n* Make sure the origin address is normalized (the step has the green checkmark icon).\r\n* Make *only* trivial changes, such as:\r\n  * Change some things to lowercase or mixed case.\r\n  * Remove the `+4` part of the ZIP code.\r\n  * Change the address suffix ('RD', 'ST', etc) to its non-abbreviated form ('road', 'street', etc).\r\n* Click the \"Use this address\" button and check that the form auto-skips to the next step, and the address was corrected automatically.\r\n* Make a different change, such as mispelling the City name, and check that you're prompted to select the original address or the corrected address.\r\n\r\n@nabsul @jeffstieler @allendav @robobot3000 ","created_at":"2016-11-17T15:48:48Z","updated_at":"2016-11-18T19:39:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a12f6c56c73a79f26ed9c57d9fbedd2fa0e5426","assignee":{"login":"DanReyLop","id":1715800,"avatar_url":"https://avatars.githubusercontent.com/u/1715800?v=3","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanReyLop","id":1715800,"avatar_url":"https://avatars.githubusercontent.com/u/1715800?v=3","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717/commits","review_comments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717/comments","review_comment_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/717/comments","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/statuses/91ff2cfe2c7160b61c4e8a8f763c525e4f820b71","head":{"label":"Automattic:update/auto-accept-address-normalization","ref":"update/auto-accept-address-normalization","sha":"91ff2cfe2c7160b61c4e8a8f763c525e4f820b71","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","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":50946955,"name":"woocommerce-connect-client","full_name":"Automattic/woocommerce-connect-client","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","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/woocommerce-connect-client","description":"WooCommerce Connect is a feature plugin, currently in Alpha, that integrates the WooCommerce Connect SaaS into WooCommerce (2.6), Alpha includes real time USPS and Canada Post shipping rates and introduces our React based UI.","fork":false,"url":"https://api.github.com/repos/Automattic/woocommerce-connect-client","forks_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/forks","keys_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/teams","hooks_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/hooks","issue_events_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/events","assignees_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/tags","blobs_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/languages","stargazers_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/stargazers","contributors_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/contributors","subscribers_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/subscribers","subscription_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/subscription","commits_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/merges","archive_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/downloads","issues_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/deployments","created_at":"2016-02-02T19:44:26Z","updated_at":"2016-11-10T17:24:19Z","pushed_at":"2016-11-18T18:51:30Z","git_url":"git://github.com/Automattic/woocommerce-connect-client.git","ssh_url":"git@github.com:Automattic/woocommerce-connect-client.git","clone_url":"https://github.com/Automattic/woocommerce-connect-client.git","svn_url":"https://github.com/Automattic/woocommerce-connect-client","homepage":"","size":3095,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":118,"forks":2,"open_issues":118,"watchers":34,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"3edec99aeb9ec28de52f1779bc58f8fb16fede99","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","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":50946955,"name":"woocommerce-connect-client","full_name":"Automattic/woocommerce-connect-client","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","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/woocommerce-connect-client","description":"WooCommerce Connect is a feature plugin, currently in Alpha, that integrates the WooCommerce Connect SaaS into WooCommerce (2.6), Alpha includes real time USPS and Canada Post shipping rates and introduces our React based UI.","fork":false,"url":"https://api.github.com/repos/Automattic/woocommerce-connect-client","forks_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/forks","keys_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/teams","hooks_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/hooks","issue_events_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/events","assignees_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/tags","blobs_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/languages","stargazers_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/stargazers","contributors_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/contributors","subscribers_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/subscribers","subscription_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/subscription","commits_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/merges","archive_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/downloads","issues_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/woocommerce-connect-client/deployments","created_at":"2016-02-02T19:44:26Z","updated_at":"2016-11-10T17:24:19Z","pushed_at":"2016-11-18T18:51:30Z","git_url":"git://github.com/Automattic/woocommerce-connect-client.git","ssh_url":"git@github.com:Automattic/woocommerce-connect-client.git","clone_url":"https://github.com/Automattic/woocommerce-connect-client.git","svn_url":"https://github.com/Automattic/woocommerce-connect-client","homepage":"","size":3095,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":118,"forks":2,"open_issues":118,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717"},"html":{"href":"https://github.com/Automattic/woocommerce-connect-client/pull/717"},"issue":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/717"},"comments":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/issues/717/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/pulls/717/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/woocommerce-connect-client/statuses/91ff2cfe2c7160b61c4e8a8f763c525e4f820b71"}}}}
{"actor":{"display_login":"DanReyLop"}}