{"action":"opened","number":389,"pull_request":{"url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389","id":92485565,"html_url":"https://github.com/rebelidealist/stripe-ruby-mock/pull/389","diff_url":"https://github.com/rebelidealist/stripe-ruby-mock/pull/389.diff","patch_url":"https://github.com/rebelidealist/stripe-ruby-mock/pull/389.patch","issue_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/389","number":389,"state":"open","locked":false,"title":"Add validations to Charge API","user":{"login":"knjko","id":35577,"avatar_url":"https://avatars.githubusercontent.com/u/35577?v=3","gravatar_id":"","url":"https://api.github.com/users/knjko","html_url":"https://github.com/knjko","followers_url":"https://api.github.com/users/knjko/followers","following_url":"https://api.github.com/users/knjko/following{/other_user}","gists_url":"https://api.github.com/users/knjko/gists{/gist_id}","starred_url":"https://api.github.com/users/knjko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knjko/subscriptions","organizations_url":"https://api.github.com/users/knjko/orgs","repos_url":"https://api.github.com/users/knjko/repos","events_url":"https://api.github.com/users/knjko/events{/privacy}","received_events_url":"https://api.github.com/users/knjko/received_events","type":"User","site_admin":false},"body":"```ruby\r\ndescribe '#charge' do\r\n  subject { Stripe::Charge.create(params) }\r\n  let(:params) { { amount: 10, currency: 'usd' } }\r\n  let(:stripe_helper) { StripeMock.create_test_helper }\r\n\r\n  before { StripeMock.start }\r\n  after { StripeMock.stop }\r\n\r\n  it { expect { subject }.to raise_error(Stripe::InvalidRequestError) }\r\nend\r\n\r\n# => expected Stripe::InvalidRequestError but nothing was raised \r\n```\r\n\r\n```ruby\r\nStripe::Charge.create({amount: 10, currency: 'usd'})\r\n# => Stripe::InvalidRequestError: Must provide source or customer.\r\n```\r\n\r\n- [Either `source` or `customer` is required](https://stripe.com/docs/api?lang=ruby#create_charge-customer) in Charge API, so I added validations.\r\n- There are specs passes `card` param to Charge API. But the API is [not allowed](https://stripe.com/docs/api?lang=ruby#create_charge) `card`, so I move from `card` to `source` param in almost specs.\r\n","created_at":"2016-11-06T12:20:31Z","updated_at":"2016-11-06T12:20:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389/commits","review_comments_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389/comments","review_comment_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/389/comments","statuses_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/statuses/675c6dbdd389fd1af365cf3e5f4bec0285dfd248","head":{"label":"knjko:add-validation-to-charge-api","ref":"add-validation-to-charge-api","sha":"675c6dbdd389fd1af365cf3e5f4bec0285dfd248","user":{"login":"knjko","id":35577,"avatar_url":"https://avatars.githubusercontent.com/u/35577?v=3","gravatar_id":"","url":"https://api.github.com/users/knjko","html_url":"https://github.com/knjko","followers_url":"https://api.github.com/users/knjko/followers","following_url":"https://api.github.com/users/knjko/following{/other_user}","gists_url":"https://api.github.com/users/knjko/gists{/gist_id}","starred_url":"https://api.github.com/users/knjko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knjko/subscriptions","organizations_url":"https://api.github.com/users/knjko/orgs","repos_url":"https://api.github.com/users/knjko/repos","events_url":"https://api.github.com/users/knjko/events{/privacy}","received_events_url":"https://api.github.com/users/knjko/received_events","type":"User","site_admin":false},"repo":{"id":72979872,"name":"stripe-ruby-mock","full_name":"knjko/stripe-ruby-mock","owner":{"login":"knjko","id":35577,"avatar_url":"https://avatars.githubusercontent.com/u/35577?v=3","gravatar_id":"","url":"https://api.github.com/users/knjko","html_url":"https://github.com/knjko","followers_url":"https://api.github.com/users/knjko/followers","following_url":"https://api.github.com/users/knjko/following{/other_user}","gists_url":"https://api.github.com/users/knjko/gists{/gist_id}","starred_url":"https://api.github.com/users/knjko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knjko/subscriptions","organizations_url":"https://api.github.com/users/knjko/orgs","repos_url":"https://api.github.com/users/knjko/repos","events_url":"https://api.github.com/users/knjko/events{/privacy}","received_events_url":"https://api.github.com/users/knjko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/knjko/stripe-ruby-mock","description":"A mocking library for testing stripe ruby","fork":true,"url":"https://api.github.com/repos/knjko/stripe-ruby-mock","forks_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/forks","keys_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/teams","hooks_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/hooks","issue_events_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/issues/events{/number}","events_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/events","assignees_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/assignees{/user}","branches_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/branches{/branch}","tags_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/tags","blobs_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/git/refs{/sha}","trees_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/statuses/{sha}","languages_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/languages","stargazers_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/stargazers","contributors_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/contributors","subscribers_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/subscribers","subscription_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/subscription","commits_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/commits{/sha}","git_commits_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/git/commits{/sha}","comments_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/comments{/number}","issue_comment_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/issues/comments{/number}","contents_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/contents/{+path}","compare_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/merges","archive_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/downloads","issues_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/issues{/number}","pulls_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/pulls{/number}","milestones_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/milestones{/number}","notifications_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/labels{/name}","releases_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/releases{/id}","deployments_url":"https://api.github.com/repos/knjko/stripe-ruby-mock/deployments","created_at":"2016-11-06T09:03:07Z","updated_at":"2016-11-06T09:03:08Z","pushed_at":"2016-11-06T11:59:19Z","git_url":"git://github.com/knjko/stripe-ruby-mock.git","ssh_url":"git@github.com:knjko/stripe-ruby-mock.git","clone_url":"https://github.com/knjko/stripe-ruby-mock.git","svn_url":"https://github.com/knjko/stripe-ruby-mock","homepage":"","size":1193,"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":"rebelidealist:master","ref":"master","sha":"20f40f227534999e7889bde01548ec4c144b5814","user":{"login":"rebelidealist","id":620577,"avatar_url":"https://avatars.githubusercontent.com/u/620577?v=3","gravatar_id":"","url":"https://api.github.com/users/rebelidealist","html_url":"https://github.com/rebelidealist","followers_url":"https://api.github.com/users/rebelidealist/followers","following_url":"https://api.github.com/users/rebelidealist/following{/other_user}","gists_url":"https://api.github.com/users/rebelidealist/gists{/gist_id}","starred_url":"https://api.github.com/users/rebelidealist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebelidealist/subscriptions","organizations_url":"https://api.github.com/users/rebelidealist/orgs","repos_url":"https://api.github.com/users/rebelidealist/repos","events_url":"https://api.github.com/users/rebelidealist/events{/privacy}","received_events_url":"https://api.github.com/users/rebelidealist/received_events","type":"Organization","site_admin":false},"repo":{"id":9735707,"name":"stripe-ruby-mock","full_name":"rebelidealist/stripe-ruby-mock","owner":{"login":"rebelidealist","id":620577,"avatar_url":"https://avatars.githubusercontent.com/u/620577?v=3","gravatar_id":"","url":"https://api.github.com/users/rebelidealist","html_url":"https://github.com/rebelidealist","followers_url":"https://api.github.com/users/rebelidealist/followers","following_url":"https://api.github.com/users/rebelidealist/following{/other_user}","gists_url":"https://api.github.com/users/rebelidealist/gists{/gist_id}","starred_url":"https://api.github.com/users/rebelidealist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebelidealist/subscriptions","organizations_url":"https://api.github.com/users/rebelidealist/orgs","repos_url":"https://api.github.com/users/rebelidealist/repos","events_url":"https://api.github.com/users/rebelidealist/events{/privacy}","received_events_url":"https://api.github.com/users/rebelidealist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rebelidealist/stripe-ruby-mock","description":"A mocking library for testing stripe ruby","fork":false,"url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock","forks_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/forks","keys_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/teams","hooks_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/hooks","issue_events_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/events{/number}","events_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/events","assignees_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/assignees{/user}","branches_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/branches{/branch}","tags_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/tags","blobs_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/git/refs{/sha}","trees_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/statuses/{sha}","languages_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/languages","stargazers_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/stargazers","contributors_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/contributors","subscribers_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/subscribers","subscription_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/subscription","commits_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/commits{/sha}","git_commits_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/git/commits{/sha}","comments_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/comments{/number}","issue_comment_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/comments{/number}","contents_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/contents/{+path}","compare_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/merges","archive_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/downloads","issues_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues{/number}","pulls_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls{/number}","milestones_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/milestones{/number}","notifications_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/labels{/name}","releases_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/releases{/id}","deployments_url":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/deployments","created_at":"2013-04-28T20:24:25Z","updated_at":"2016-11-03T01:11:06Z","pushed_at":"2016-11-06T12:20:31Z","git_url":"git://github.com/rebelidealist/stripe-ruby-mock.git","ssh_url":"git@github.com:rebelidealist/stripe-ruby-mock.git","clone_url":"https://github.com/rebelidealist/stripe-ruby-mock.git","svn_url":"https://github.com/rebelidealist/stripe-ruby-mock","homepage":"","size":1193,"stargazers_count":481,"watchers_count":481,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":294,"mirror_url":null,"open_issues_count":81,"forks":294,"open_issues":81,"watchers":481,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389"},"html":{"href":"https://github.com/rebelidealist/stripe-ruby-mock/pull/389"},"issue":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/389"},"comments":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/issues/389/comments"},"review_comments":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389/comments"},"review_comment":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/pulls/389/commits"},"statuses":{"href":"https://api.github.com/repos/rebelidealist/stripe-ruby-mock/statuses/675c6dbdd389fd1af365cf3e5f4bec0285dfd248"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":59,"deletions":36,"changed_files":7}}
{"actor":{"display_login":"knjko"}}