{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/61155909","id":61155909,"diff_hunk":"@@ -59,7 +59,15 @@\n     <p class='field' data-hook='coupon_code'>\n       <%= form.label :coupon_code %><br />\n       <%= form.text_field :coupon_code %>\n+      <button type=\"button\" class=\"button\" id=\"coupon-code-apply-button\">\n+        <%= Spree.t(:apply_code) %>\n+      </button>\n     </p>\n+    <div id='coupon_status'","path":"frontend/app/views/spree/checkout/_payment.html.erb","position":8,"original_position":8,"commit_id":"9b529c1415c1b5d6f6d049e7f2f38e27b7e9c5d5","original_commit_id":"9b529c1415c1b5d6f6d049e7f2f38e27b7e9c5d5","user":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"body":"I believe this should be inside the above `<p>` tag to match the existing behaviour.","created_at":"2016-04-26T20:13:59Z","updated_at":"2016-04-26T20:13:59Z","html_url":"https://github.com/solidusio/solidus/pull/1090#discussion_r61155909","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1090","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/61155909"},"html":{"href":"https://github.com/solidusio/solidus/pull/1090#discussion_r61155909"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1090"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1090","id":67397478,"html_url":"https://github.com/solidusio/solidus/pull/1090","diff_url":"https://github.com/solidusio/solidus/pull/1090.diff","patch_url":"https://github.com/solidusio/solidus/pull/1090.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1090","number":1090,"state":"open","locked":false,"title":"Improve coupon code JS applicator","user":{"login":"mtomov","id":1651750,"avatar_url":"https://avatars.githubusercontent.com/u/1651750?v=3","gravatar_id":"","url":"https://api.github.com/users/mtomov","html_url":"https://github.com/mtomov","followers_url":"https://api.github.com/users/mtomov/followers","following_url":"https://api.github.com/users/mtomov/following{/other_user}","gists_url":"https://api.github.com/users/mtomov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtomov/subscriptions","organizations_url":"https://api.github.com/users/mtomov/orgs","repos_url":"https://api.github.com/users/mtomov/repos","events_url":"https://api.github.com/users/mtomov/events{/privacy}","received_events_url":"https://api.github.com/users/mtomov/received_events","type":"User","site_admin":false},"body":"* Separate Coupon code application from Saving & processing a payment \r\n\r\n    » allows users to first apply a code, and subsequently add payment details when they are certain of the final amount to be paid.\r\n\r\n\r\n* Add new button Apply Code\r\n\r\n* Separate payment js from coupon code js - allows for easier override\r\n   as they are now in separate files.\r\n\r\n* Allow customisation of the CSS classes applied on success and on error\r\n   via data attributes `data-success-class` and `data-success-error`.\r\n\r\n* Fix a refresh bug on coupon code application error - before, the page\r\n   was refreshed even after displaying an AJAX brought error message.\r\n   See issue & fix @Spree https://github.com/spree/spree/pull/7040\r\n\r\n* Fixes a JS warning that a Synchronous AJAX request was executed, which could impact JS performance as it waits for response from the server before continuing the execution of the JS. (Was coming from the `async:false` setting)\r\n\r\n* Switch to using the Spree API action for applying a code instead of the\r\n   Frontend controller one at StoreController#apply_code.\r\n\r\n   TODO: Delete the StoreController#apply_code similarly to Spree as\r\n         it's not used anymore. See: https://github.com/spree/spree/pull/7284\r\n\r\n\r\n--\r\n![coupon code applied successfully](https://cloud.githubusercontent.com/assets/1651750/14719723/b5e66456-07f5-11e6-9f28-da07e2bd932f.png)\r\n\r\n![coupon code doesnt exist](https://cloud.githubusercontent.com/assets/1651750/14719722/b5e51470-07f5-11e6-88b3-ddad549e7059.png)\r\n\r\n![coupon code already applied](https://cloud.githubusercontent.com/assets/1651750/14719724/b5e78444-07f5-11e6-9b0f-3d45b2d82aed.png)\r\n","created_at":"2016-04-21T18:06:53Z","updated_at":"2016-04-26T20:13:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eebc3cc1f30ed3be3eecc1c72c6372b38d40bae6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1090/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1090/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1090/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/9b529c1415c1b5d6f6d049e7f2f38e27b7e9c5d5","head":{"label":"mtomov:improve-coupon-code-applicator","ref":"improve-coupon-code-applicator","sha":"9b529c1415c1b5d6f6d049e7f2f38e27b7e9c5d5","user":{"login":"mtomov","id":1651750,"avatar_url":"https://avatars.githubusercontent.com/u/1651750?v=3","gravatar_id":"","url":"https://api.github.com/users/mtomov","html_url":"https://github.com/mtomov","followers_url":"https://api.github.com/users/mtomov/followers","following_url":"https://api.github.com/users/mtomov/following{/other_user}","gists_url":"https://api.github.com/users/mtomov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtomov/subscriptions","organizations_url":"https://api.github.com/users/mtomov/orgs","repos_url":"https://api.github.com/users/mtomov/repos","events_url":"https://api.github.com/users/mtomov/events{/privacy}","received_events_url":"https://api.github.com/users/mtomov/received_events","type":"User","site_admin":false},"repo":{"id":45399489,"name":"solidus","full_name":"mtomov/solidus","owner":{"login":"mtomov","id":1651750,"avatar_url":"https://avatars.githubusercontent.com/u/1651750?v=3","gravatar_id":"","url":"https://api.github.com/users/mtomov","html_url":"https://github.com/mtomov","followers_url":"https://api.github.com/users/mtomov/followers","following_url":"https://api.github.com/users/mtomov/following{/other_user}","gists_url":"https://api.github.com/users/mtomov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtomov/subscriptions","organizations_url":"https://api.github.com/users/mtomov/orgs","repos_url":"https://api.github.com/users/mtomov/repos","events_url":"https://api.github.com/users/mtomov/events{/privacy}","received_events_url":"https://api.github.com/users/mtomov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mtomov/solidus","description":"Solidus, Rails eCommerce System","fork":true,"url":"https://api.github.com/repos/mtomov/solidus","forks_url":"https://api.github.com/repos/mtomov/solidus/forks","keys_url":"https://api.github.com/repos/mtomov/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mtomov/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mtomov/solidus/teams","hooks_url":"https://api.github.com/repos/mtomov/solidus/hooks","issue_events_url":"https://api.github.com/repos/mtomov/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/mtomov/solidus/events","assignees_url":"https://api.github.com/repos/mtomov/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/mtomov/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/mtomov/solidus/tags","blobs_url":"https://api.github.com/repos/mtomov/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mtomov/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mtomov/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/mtomov/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mtomov/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/mtomov/solidus/languages","stargazers_url":"https://api.github.com/repos/mtomov/solidus/stargazers","contributors_url":"https://api.github.com/repos/mtomov/solidus/contributors","subscribers_url":"https://api.github.com/repos/mtomov/solidus/subscribers","subscription_url":"https://api.github.com/repos/mtomov/solidus/subscription","commits_url":"https://api.github.com/repos/mtomov/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/mtomov/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/mtomov/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/mtomov/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/mtomov/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/mtomov/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mtomov/solidus/merges","archive_url":"https://api.github.com/repos/mtomov/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mtomov/solidus/downloads","issues_url":"https://api.github.com/repos/mtomov/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/mtomov/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/mtomov/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/mtomov/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mtomov/solidus/labels{/name}","releases_url":"https://api.github.com/repos/mtomov/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/mtomov/solidus/deployments","created_at":"2015-11-02T14:29:49Z","updated_at":"2016-02-20T20:21:03Z","pushed_at":"2016-04-21T18:42:24Z","git_url":"git://github.com/mtomov/solidus.git","ssh_url":"git@github.com:mtomov/solidus.git","clone_url":"https://github.com/mtomov/solidus.git","svn_url":"https://github.com/mtomov/solidus","homepage":"http://solidus.io/","size":63047,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"solidusio:master","ref":"master","sha":"c0bcd30e09f922109ac1c1018d93e606d7257227","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/solidusio/solidus/deployments","created_at":"2015-02-18T20:41:58Z","updated_at":"2016-04-26T08:36:24Z","pushed_at":"2016-04-26T16:37:32Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"http://solidus.io/","size":68789,"stargazers_count":901,"watchers_count":901,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":242,"mirror_url":null,"open_issues_count":106,"forks":242,"open_issues":106,"watchers":901,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1090"},"html":{"href":"https://github.com/solidusio/solidus/pull/1090"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1090"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1090/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1090/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1090/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/9b529c1415c1b5d6f6d049e7f2f38e27b7e9c5d5"}}}}