{"action":"closed","number":475,"pull_request":{"url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475","id":213457332,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNDU3MzMy","html_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/pull/475","diff_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/pull/475.diff","patch_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/pull/475.patch","issue_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/475","number":475,"state":"closed","locked":false,"title":"Validate checkout form via AJAX upon opening payment flow","user":{"login":"dechov","id":1867547,"node_id":"MDQ6VXNlcjE4Njc1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/451\r\n\r\nCurrently, the terms of service checkbox (and the rest of the checkout form's required fields) are validated only after the payment flow is complete, which causes an unnecessary loop in the flow and is too late. This change ensures that form data is sent along with the payment initialization call when a Smart Payment Button is clicked. On the Checkout screen, this triggers form validation on the server, and errors are reported.\r\n\r\nExample with empty required fields:\r\n\r\n<img width=\"200\" alt=\"screen shot 2018-09-05 at 6 45 31 pm\" src=\"https://user-images.githubusercontent.com/1867547/45125500-c1a88100-b13c-11e8-8564-d1732da10668.png\">\r\n\r\nExample with terms of service unchecked:\r\n\r\n<img width=\"200\" alt=\"screen shot 2018-09-05 at 6 45 49 pm\" src=\"https://user-images.githubusercontent.com/1867547/45125504-c2d9ae00-b13c-11e8-970b-6ef6a918650a.png\">\r\n\r\nMay be a step towards solving https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/467 (at least for the Smart Payment Buttons case).","created_at":"2018-09-05T23:38:55Z","updated_at":"2018-09-26T19:11:34Z","closed_at":"2018-09-26T19:11:34Z","merged_at":"2018-09-26T19:11:33Z","merge_commit_sha":"9825dd2b054d51d594c462788bb32afcab22b4e3","assignee":{"login":"dechov","id":1867547,"node_id":"MDQ6VXNlcjE4Njc1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false},"assignees":[{"login":"dechov","id":1867547,"node_id":"MDQ6VXNlcjE4Njc1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":339339797,"node_id":"MDU6TGFiZWwzMzkzMzk3OTc=","url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/labels/[Status]%20Ready%20to%20Merge","name":"[Status] Ready to Merge","color":"d4fb79","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475/commits","review_comments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475/comments","review_comment_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/comments{/number}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/475/comments","statuses_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/statuses/28b2c2b1a86c1907474465156859dc907041a69f","head":{"label":"woocommerce:add/checkout-form-validation-on-spb-click","ref":"add/checkout-form-validation-on-spb-click","sha":"28b2c2b1a86c1907474465156859dc907041a69f","user":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":51159002,"node_id":"MDEwOlJlcG9zaXRvcnk1MTE1OTAwMg==","name":"woocommerce-gateway-paypal-express-checkout","full_name":"woocommerce/woocommerce-gateway-paypal-express-checkout","private":false,"owner":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout","description":null,"fork":false,"url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout","forks_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/forks","keys_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/teams","hooks_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/hooks","issue_events_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/events{/number}","events_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/events","assignees_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/assignees{/user}","branches_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/branches{/branch}","tags_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/tags","blobs_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/refs{/sha}","trees_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/statuses/{sha}","languages_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/languages","stargazers_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/stargazers","contributors_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/contributors","subscribers_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/subscribers","subscription_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/subscription","commits_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/commits{/sha}","git_commits_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/commits{/sha}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/comments{/number}","issue_comment_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/comments{/number}","contents_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/contents/{+path}","compare_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/merges","archive_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/downloads","issues_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues{/number}","pulls_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls{/number}","milestones_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/milestones{/number}","notifications_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/labels{/name}","releases_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/releases{/id}","deployments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/deployments","created_at":"2016-02-05T16:35:33Z","updated_at":"2018-09-20T16:16:46Z","pushed_at":"2018-09-26T19:11:34Z","git_url":"git://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout.git","ssh_url":"git@github.com:woocommerce/woocommerce-gateway-paypal-express-checkout.git","clone_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout.git","svn_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout","homepage":null,"size":5833,"stargazers_count":18,"watchers_count":18,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":59,"license":null,"forks":22,"open_issues":59,"watchers":18,"default_branch":"master"}},"base":{"label":"woocommerce:master","ref":"master","sha":"cf3cbe82a033ff2e07948894d03cfbcb6fdcda37","user":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":51159002,"node_id":"MDEwOlJlcG9zaXRvcnk1MTE1OTAwMg==","name":"woocommerce-gateway-paypal-express-checkout","full_name":"woocommerce/woocommerce-gateway-paypal-express-checkout","private":false,"owner":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout","description":null,"fork":false,"url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout","forks_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/forks","keys_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/teams","hooks_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/hooks","issue_events_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/events{/number}","events_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/events","assignees_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/assignees{/user}","branches_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/branches{/branch}","tags_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/tags","blobs_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/refs{/sha}","trees_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/statuses/{sha}","languages_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/languages","stargazers_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/stargazers","contributors_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/contributors","subscribers_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/subscribers","subscription_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/subscription","commits_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/commits{/sha}","git_commits_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/git/commits{/sha}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/comments{/number}","issue_comment_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/comments{/number}","contents_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/contents/{+path}","compare_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/merges","archive_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/downloads","issues_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues{/number}","pulls_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls{/number}","milestones_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/milestones{/number}","notifications_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/labels{/name}","releases_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/releases{/id}","deployments_url":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/deployments","created_at":"2016-02-05T16:35:33Z","updated_at":"2018-09-20T16:16:46Z","pushed_at":"2018-09-26T19:11:34Z","git_url":"git://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout.git","ssh_url":"git@github.com:woocommerce/woocommerce-gateway-paypal-express-checkout.git","clone_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout.git","svn_url":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout","homepage":null,"size":5833,"stargazers_count":18,"watchers_count":18,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":59,"license":null,"forks":22,"open_issues":59,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475"},"html":{"href":"https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/pull/475"},"issue":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/475"},"comments":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/issues/475/comments"},"review_comments":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475/comments"},"review_comment":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/pulls/475/commits"},"statuses":{"href":"https://api.github.com/repos/woocommerce/woocommerce-gateway-paypal-express-checkout/statuses/28b2c2b1a86c1907474465156859dc907041a69f"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"dechov","id":1867547,"node_id":"MDQ6VXNlcjE4Njc1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false},"comments":8,"review_comments":0,"maintainer_can_modify":false,"commits":8,"additions":87,"deletions":10,"changed_files":4}}
{"actor":{"display_login":"dechov"}}