{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/193187823","pull_request_review_id":126111341,"id":193187823,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzE4NzgyMw==","diff_hunk":"@@ -59,6 +59,12 @@ wp.isJetpackWidgetPlaced = function( placement, widgetName ) {\n \t\t\t\t\t} else if ( wp.isJetpackWidgetPlaced( placement, 'eu_cookie_law_widget' ) ) {\n \t\t\t\t\t\t// Refresh EU Cookie Law\n \t\t\t\t\t\tplacement.container.fadeIn();\n+\t\t\t\t\t} else if ( wp.isJetpackWidgetPlaced( placement, 'jetpack_simple_payments_widget' ) ) {","path":"modules/widgets/customizer-utils.js","position":10,"original_position":10,"commit_id":"cd628a2ad8f346fb1348a26bdcbfab694442a282","original_commit_id":"cd628a2ad8f346fb1348a26bdcbfab694442a282","user":{"login":"gwwar","id":1270189,"node_id":"MDQ6VXNlcjEyNzAxODk=","avatar_url":"https://avatars3.githubusercontent.com/u/1270189?v=4","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"body":"For folks reading, internally this calls. So I think theoretically we should only have one of these fire at a time, based on what we're editing.\r\n```\r\n/**\r\n * Verifies that the placed widget ID contains the widget name.\r\n * @param {object} placement\r\n * @param {string} widgetName\r\n * @returns {*|boolean}\r\n */\r\nwp.isJetpackWidgetPlaced = function( placement, widgetName ) {\r\n\treturn placement.partial.widgetId && 0 === placement.partial.widgetId.indexOf( widgetName );\r\n};\r\n```","created_at":"2018-06-05T19:09:42Z","updated_at":"2018-06-05T19:09:43Z","html_url":"https://github.com/Automattic/jetpack/pull/9668#discussion_r193187823","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/9668","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/193187823"},"html":{"href":"https://github.com/Automattic/jetpack/pull/9668#discussion_r193187823"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/9668"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/9668","id":191820445,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxODIwNDQ1","html_url":"https://github.com/Automattic/jetpack/pull/9668","diff_url":"https://github.com/Automattic/jetpack/pull/9668.diff","patch_url":"https://github.com/Automattic/jetpack/pull/9668.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/9668","number":9668,"state":"open","locked":false,"title":"Widgets: Make the Simple Payments button compatible with Selective Refresh","user":{"login":"Copons","id":2070010,"node_id":"MDQ6VXNlcjIwNzAwMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2070010?v=4","gravatar_id":"","url":"https://api.github.com/users/Copons","html_url":"https://github.com/Copons","followers_url":"https://api.github.com/users/Copons/followers","following_url":"https://api.github.com/users/Copons/following{/other_user}","gists_url":"https://api.github.com/users/Copons/gists{/gist_id}","starred_url":"https://api.github.com/users/Copons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copons/subscriptions","organizations_url":"https://api.github.com/users/Copons/orgs","repos_url":"https://api.github.com/users/Copons/repos","events_url":"https://api.github.com/users/Copons/events{/privacy}","received_events_url":"https://api.github.com/users/Copons/received_events","type":"User","site_admin":false},"body":"Require #9577 \r\n\r\nThe Simple Payments module works basically like this: whenever the Simple Payments button is rendered, it calls a JS script that in turns renders a PayPal button.\r\nThis doesn't happen with the Simple Payments widget, when the Customizer _selectively refreshes_ it.\r\n\r\n#### Changes proposed in this Pull Request:\r\n\r\n* Add the Simple Payments widget to the widgets that support Selective Refresh.\r\n* Upon widget change or move, trigger a new PayPal button render on the updated widget button.\r\n\r\n#### Testing instructions:\r\n\r\n* Pick a Premium/Business site with one or more Simple Payments button already created.\r\n* Open the Customizer and add a Simple Payments widget.\r\n* Edit the widget, wait for the Customizer to refresh it, and make sure its PayPal button is still visible.\r\n* Move the widget, and again check if the PayPal button is there.","created_at":"2018-05-31T17:18:50Z","updated_at":"2018-06-05T19:09:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5633fdc69af893d18d47510f220d71ba149c58fe","assignee":{"login":"Copons","id":2070010,"node_id":"MDQ6VXNlcjIwNzAwMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2070010?v=4","gravatar_id":"","url":"https://api.github.com/users/Copons","html_url":"https://github.com/Copons","followers_url":"https://api.github.com/users/Copons/followers","following_url":"https://api.github.com/users/Copons/following{/other_user}","gists_url":"https://api.github.com/users/Copons/gists{/gist_id}","starred_url":"https://api.github.com/users/Copons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copons/subscriptions","organizations_url":"https://api.github.com/users/Copons/orgs","repos_url":"https://api.github.com/users/Copons/repos","events_url":"https://api.github.com/users/Copons/events{/privacy}","received_events_url":"https://api.github.com/users/Copons/received_events","type":"User","site_admin":false},"assignees":[{"login":"Copons","id":2070010,"node_id":"MDQ6VXNlcjIwNzAwMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2070010?v=4","gravatar_id":"","url":"https://api.github.com/users/Copons","html_url":"https://github.com/Copons","followers_url":"https://api.github.com/users/Copons/followers","following_url":"https://api.github.com/users/Copons/following{/other_user}","gists_url":"https://api.github.com/users/Copons/gists{/gist_id}","starred_url":"https://api.github.com/users/Copons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copons/subscriptions","organizations_url":"https://api.github.com/users/Copons/orgs","repos_url":"https://api.github.com/users/Copons/repos","events_url":"https://api.github.com/users/Copons/events{/privacy}","received_events_url":"https://api.github.com/users/Copons/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[{"name":"Jetpack","id":2149533,"node_id":"MDQ6VGVhbTIxNDk1MzM=","slug":"jetpack","description":"The Jetpack team, who has merge access for Jetpack","privacy":"closed","url":"https://api.github.com/teams/2149533","members_url":"https://api.github.com/teams/2149533/members{/member}","repositories_url":"https://api.github.com/teams/2149533/repos","permission":"pull"}],"labels":[{"id":70993307,"node_id":"MDU6TGFiZWw3MDk5MzMwNw==","url":"https://api.github.com/repos/Automattic/jetpack/labels/Extra%20Sidebar%20Widgets","name":"Extra Sidebar Widgets","color":"006b75","default":false},{"id":666799304,"node_id":"MDU6TGFiZWw2NjY3OTkzMDQ=","url":"https://api.github.com/repos/Automattic/jetpack/labels/Simple%20Payments","name":"Simple Payments","color":"006b75","default":false},{"id":371672245,"node_id":"MDU6TGFiZWwzNzE2NzIyNDU=","url":"https://api.github.com/repos/Automattic/jetpack/labels/Touches%20WP.com%20Files","name":"Touches WP.com Files","color":"0087be","default":false},{"id":199076921,"node_id":"MDU6TGFiZWwxOTkwNzY5MjE=","url":"https://api.github.com/repos/Automattic/jetpack/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/9668/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/9668/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/9668/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/cd628a2ad8f346fb1348a26bdcbfab694442a282","head":{"label":"Automattic:fix/simple-payment-widget-customizer-reload-script","ref":"fix/simple-payment-widget-customizer-reload-script","sha":"cd628a2ad8f346fb1348a26bdcbfab694442a282","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","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":15231212,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMTIxMg==","name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","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/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-06-05T16:35:15Z","pushed_at":"2018-06-05T17:56:23Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":212695,"stargazers_count":793,"watchers_count":793,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":517,"mirror_url":null,"archived":false,"open_issues_count":1090,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":517,"open_issues":1090,"watchers":793,"default_branch":"master"}},"base":{"label":"Automattic:feature/widgets/simple-payment-widget","ref":"feature/widgets/simple-payment-widget","sha":"323a9b4f0de08d6d7c1b20ca4cb1ff9cf6d3e33b","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","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":15231212,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMTIxMg==","name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","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/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-06-05T16:35:15Z","pushed_at":"2018-06-05T17:56:23Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":212695,"stargazers_count":793,"watchers_count":793,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":517,"mirror_url":null,"archived":false,"open_issues_count":1090,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":517,"open_issues":1090,"watchers":793,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/9668"},"html":{"href":"https://github.com/Automattic/jetpack/pull/9668"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/9668"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/9668/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/9668/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/9668/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/cd628a2ad8f346fb1348a26bdcbfab694442a282"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gwwar"}}