{"action":"created","comment":{"url":"https://api.github.com/repos/stefanosc/myflix/pulls/comments/26441619","id":26441619,"diff_hunk":"@@ -0,0 +1,37 @@\n+module StripeWrapper\n+  class Charge\n+\n+    attr_reader :response, :status\n+\n+    def initialize(response, status)\n+      @response = response\n+      @status   = status\n+    end\n+\n+    def self.create(opts={})\n+      set_api_key\n+      begin\n+        response = Stripe::Charge.create(\n+          currency:  'usd',\n+          amount:    opts[:amount],\n+          card:      opts[:card]\n+        )\n+        new(response, :success)\n+      rescue Stripe::CardError => e\n+        new(e, :error)\n+      end\n+    end\n+\n+    def successful?\n+      status == :success\n+    end\n+\n+    def error_message\n+      response.message\n+    end\n+\n+    def self.set_api_key\n+      Stripe.api_key = ENV[\"STRIPE_API_KEY\"]","path":"app/models/stripe_wrapper.rb","position":34,"original_position":34,"commit_id":"33f1e5ab3291d12b181e6e68ff6b7107e2bd2d28","original_commit_id":"d426da9fcbd76f406519c8c1d04e75933e8c4904","user":{"login":"tomtomecek","id":7385469,"avatar_url":"https://avatars.githubusercontent.com/u/7385469?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtomecek","html_url":"https://github.com/tomtomecek","followers_url":"https://api.github.com/users/tomtomecek/followers","following_url":"https://api.github.com/users/tomtomecek/following{/other_user}","gists_url":"https://api.github.com/users/tomtomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtomecek/subscriptions","organizations_url":"https://api.github.com/users/tomtomecek/orgs","repos_url":"https://api.github.com/users/tomtomecek/repos","events_url":"https://api.github.com/users/tomtomecek/events{/privacy}","received_events_url":"https://api.github.com/users/tomtomecek/received_events","type":"User","site_admin":false},"body":"You are welcome!\r\n\r\nYes, just that 1 line, when your rails app bootstraps it will be read. You can delete the method.","created_at":"2015-03-14T20:45:17Z","updated_at":"2015-03-14T20:45:17Z","html_url":"https://github.com/stefanosc/myflix/pull/14#discussion_r26441619","pull_request_url":"https://api.github.com/repos/stefanosc/myflix/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/comments/26441619"},"html":{"href":"https://github.com/stefanosc/myflix/pull/14#discussion_r26441619"},"pull_request":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/stefanosc/myflix/pulls/14","id":31185621,"html_url":"https://github.com/stefanosc/myflix/pull/14","diff_url":"https://github.com/stefanosc/myflix/pull/14.diff","patch_url":"https://github.com/stefanosc/myflix/pull/14.patch","issue_url":"https://api.github.com/repos/stefanosc/myflix/issues/14","number":14,"state":"open","locked":false,"title":"Mod 13","user":{"login":"stefanosc","id":4052799,"avatar_url":"https://avatars.githubusercontent.com/u/4052799?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanosc","html_url":"https://github.com/stefanosc","followers_url":"https://api.github.com/users/stefanosc/followers","following_url":"https://api.github.com/users/stefanosc/following{/other_user}","gists_url":"https://api.github.com/users/stefanosc/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanosc/subscriptions","organizations_url":"https://api.github.com/users/stefanosc/orgs","repos_url":"https://api.github.com/users/stefanosc/repos","events_url":"https://api.github.com/users/stefanosc/events{/privacy}","received_events_url":"https://api.github.com/users/stefanosc/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-14T16:11:55Z","updated_at":"2015-03-14T20:45:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55ac84bf6f59136714c84c5fe4b6ed2b02cc4dc8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stefanosc/myflix/pulls/14/commits","review_comments_url":"https://api.github.com/repos/stefanosc/myflix/pulls/14/comments","review_comment_url":"https://api.github.com/repos/stefanosc/myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stefanosc/myflix/issues/14/comments","statuses_url":"https://api.github.com/repos/stefanosc/myflix/statuses/33f1e5ab3291d12b181e6e68ff6b7107e2bd2d28","head":{"label":"stefanosc:mod-13","ref":"mod-13","sha":"33f1e5ab3291d12b181e6e68ff6b7107e2bd2d28","user":{"login":"stefanosc","id":4052799,"avatar_url":"https://avatars.githubusercontent.com/u/4052799?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanosc","html_url":"https://github.com/stefanosc","followers_url":"https://api.github.com/users/stefanosc/followers","following_url":"https://api.github.com/users/stefanosc/following{/other_user}","gists_url":"https://api.github.com/users/stefanosc/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanosc/subscriptions","organizations_url":"https://api.github.com/users/stefanosc/orgs","repos_url":"https://api.github.com/users/stefanosc/repos","events_url":"https://api.github.com/users/stefanosc/events{/privacy}","received_events_url":"https://api.github.com/users/stefanosc/received_events","type":"User","site_admin":false},"repo":{"id":15831536,"name":"myflix","full_name":"stefanosc/myflix","owner":{"login":"stefanosc","id":4052799,"avatar_url":"https://avatars.githubusercontent.com/u/4052799?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanosc","html_url":"https://github.com/stefanosc","followers_url":"https://api.github.com/users/stefanosc/followers","following_url":"https://api.github.com/users/stefanosc/following{/other_user}","gists_url":"https://api.github.com/users/stefanosc/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanosc/subscriptions","organizations_url":"https://api.github.com/users/stefanosc/orgs","repos_url":"https://api.github.com/users/stefanosc/repos","events_url":"https://api.github.com/users/stefanosc/events{/privacy}","received_events_url":"https://api.github.com/users/stefanosc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanosc/myflix","description":"A video platform using rails","fork":true,"url":"https://api.github.com/repos/stefanosc/myflix","forks_url":"https://api.github.com/repos/stefanosc/myflix/forks","keys_url":"https://api.github.com/repos/stefanosc/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanosc/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanosc/myflix/teams","hooks_url":"https://api.github.com/repos/stefanosc/myflix/hooks","issue_events_url":"https://api.github.com/repos/stefanosc/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/stefanosc/myflix/events","assignees_url":"https://api.github.com/repos/stefanosc/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/stefanosc/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/stefanosc/myflix/tags","blobs_url":"https://api.github.com/repos/stefanosc/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanosc/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanosc/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanosc/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanosc/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanosc/myflix/languages","stargazers_url":"https://api.github.com/repos/stefanosc/myflix/stargazers","contributors_url":"https://api.github.com/repos/stefanosc/myflix/contributors","subscribers_url":"https://api.github.com/repos/stefanosc/myflix/subscribers","subscription_url":"https://api.github.com/repos/stefanosc/myflix/subscription","commits_url":"https://api.github.com/repos/stefanosc/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanosc/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanosc/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanosc/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanosc/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/stefanosc/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanosc/myflix/merges","archive_url":"https://api.github.com/repos/stefanosc/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanosc/myflix/downloads","issues_url":"https://api.github.com/repos/stefanosc/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/stefanosc/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanosc/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanosc/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanosc/myflix/labels{/name}","releases_url":"https://api.github.com/repos/stefanosc/myflix/releases{/id}","created_at":"2014-01-11T22:03:26Z","updated_at":"2014-07-31T20:35:16Z","pushed_at":"2015-03-14T20:31:22Z","git_url":"git://github.com/stefanosc/myflix.git","ssh_url":"git@github.com:stefanosc/myflix.git","clone_url":"https://github.com/stefanosc/myflix.git","svn_url":"https://github.com/stefanosc/myflix","homepage":"","size":1343,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"stefanosc:master","ref":"master","sha":"fa256ab18c12126a33b72a956bc21a8b0fc37c34","user":{"login":"stefanosc","id":4052799,"avatar_url":"https://avatars.githubusercontent.com/u/4052799?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanosc","html_url":"https://github.com/stefanosc","followers_url":"https://api.github.com/users/stefanosc/followers","following_url":"https://api.github.com/users/stefanosc/following{/other_user}","gists_url":"https://api.github.com/users/stefanosc/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanosc/subscriptions","organizations_url":"https://api.github.com/users/stefanosc/orgs","repos_url":"https://api.github.com/users/stefanosc/repos","events_url":"https://api.github.com/users/stefanosc/events{/privacy}","received_events_url":"https://api.github.com/users/stefanosc/received_events","type":"User","site_admin":false},"repo":{"id":15831536,"name":"myflix","full_name":"stefanosc/myflix","owner":{"login":"stefanosc","id":4052799,"avatar_url":"https://avatars.githubusercontent.com/u/4052799?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanosc","html_url":"https://github.com/stefanosc","followers_url":"https://api.github.com/users/stefanosc/followers","following_url":"https://api.github.com/users/stefanosc/following{/other_user}","gists_url":"https://api.github.com/users/stefanosc/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanosc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanosc/subscriptions","organizations_url":"https://api.github.com/users/stefanosc/orgs","repos_url":"https://api.github.com/users/stefanosc/repos","events_url":"https://api.github.com/users/stefanosc/events{/privacy}","received_events_url":"https://api.github.com/users/stefanosc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stefanosc/myflix","description":"A video platform using rails","fork":true,"url":"https://api.github.com/repos/stefanosc/myflix","forks_url":"https://api.github.com/repos/stefanosc/myflix/forks","keys_url":"https://api.github.com/repos/stefanosc/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stefanosc/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stefanosc/myflix/teams","hooks_url":"https://api.github.com/repos/stefanosc/myflix/hooks","issue_events_url":"https://api.github.com/repos/stefanosc/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/stefanosc/myflix/events","assignees_url":"https://api.github.com/repos/stefanosc/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/stefanosc/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/stefanosc/myflix/tags","blobs_url":"https://api.github.com/repos/stefanosc/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stefanosc/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stefanosc/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/stefanosc/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stefanosc/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/stefanosc/myflix/languages","stargazers_url":"https://api.github.com/repos/stefanosc/myflix/stargazers","contributors_url":"https://api.github.com/repos/stefanosc/myflix/contributors","subscribers_url":"https://api.github.com/repos/stefanosc/myflix/subscribers","subscription_url":"https://api.github.com/repos/stefanosc/myflix/subscription","commits_url":"https://api.github.com/repos/stefanosc/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/stefanosc/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/stefanosc/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/stefanosc/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/stefanosc/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/stefanosc/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stefanosc/myflix/merges","archive_url":"https://api.github.com/repos/stefanosc/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stefanosc/myflix/downloads","issues_url":"https://api.github.com/repos/stefanosc/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/stefanosc/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/stefanosc/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/stefanosc/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stefanosc/myflix/labels{/name}","releases_url":"https://api.github.com/repos/stefanosc/myflix/releases{/id}","created_at":"2014-01-11T22:03:26Z","updated_at":"2014-07-31T20:35:16Z","pushed_at":"2015-03-14T20:31:22Z","git_url":"git://github.com/stefanosc/myflix.git","ssh_url":"git@github.com:stefanosc/myflix.git","clone_url":"https://github.com/stefanosc/myflix.git","svn_url":"https://github.com/stefanosc/myflix","homepage":"","size":1343,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/14"},"html":{"href":"https://github.com/stefanosc/myflix/pull/14"},"issue":{"href":"https://api.github.com/repos/stefanosc/myflix/issues/14"},"comments":{"href":"https://api.github.com/repos/stefanosc/myflix/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stefanosc/myflix/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/stefanosc/myflix/statuses/33f1e5ab3291d12b181e6e68ff6b7107e2bd2d28"}}}}