{"action":"created","comment":{"url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/comments/88795732","pull_request_review_id":9359522,"id":88795732,"diff_hunk":"@@ -0,0 +1,24 @@\n+defmodule CodeCorps.Stripe.InMemory do\n+  defmodule Customer do\n+    def create(map) do\n+      {:ok, do_create(map)}\n+    end\n+\n+    defp do_create(_) do\n+      {:ok, created} = DateTime.from_unix(1479472835)\n+\n+      %Stripe.Customer{\n+        id: \"cus_9aMOFmqy1esIRE\",\n+        account_balance: 0,\n+        created: created,\n+        currency: \"usd\",\n+        default_source: nil,\n+        delinquent: false,\n+        description: nil,\n+        email: \"mail@test.com\",\n+        livemode: false,\n+        metadata: %{}\n+      }\n+    end","path":"lib/code_corps/stripe/in_memory.ex","position":22,"original_position":22,"commit_id":"b482efdb3e7501b9f205dee3450f81dc76adf682","original_commit_id":"b482efdb3e7501b9f205dee3450f81dc76adf682","user":{"login":"JoshSmith","id":321667,"avatar_url":"https://avatars.githubusercontent.com/u/321667?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshSmith","html_url":"https://github.com/JoshSmith","followers_url":"https://api.github.com/users/JoshSmith/followers","following_url":"https://api.github.com/users/JoshSmith/following{/other_user}","gists_url":"https://api.github.com/users/JoshSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshSmith/subscriptions","organizations_url":"https://api.github.com/users/JoshSmith/orgs","repos_url":"https://api.github.com/users/JoshSmith/repos","events_url":"https://api.github.com/users/JoshSmith/events{/privacy}","received_events_url":"https://api.github.com/users/JoshSmith/received_events","type":"User","site_admin":false},"body":"I'm not sure this has gone far enough. In http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/ it looks like the recommendation is to use behaviours and callbacks. That is, we seem to be lacking explicit contracts right now.\r\n\r\nThe boundary of testing the HTTP interactions should probably happen at the level of `stripity-stripe` and not here, so I don't think that will have to be added. But even in adjusting the small cases we have here, I ended up with the behavior getting out of sync because the contract is not explicit.","created_at":"2016-11-20T08:10:36Z","updated_at":"2016-11-20T08:25:31Z","html_url":"https://github.com/code-corps/code-corps-api/pull/455#discussion_r88795732","pull_request_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455","_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/comments/88795732"},"html":{"href":"https://github.com/code-corps/code-corps-api/pull/455#discussion_r88795732"},"pull_request":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455"}}},"pull_request":{"url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455","id":93240233,"html_url":"https://github.com/code-corps/code-corps-api/pull/455","diff_url":"https://github.com/code-corps/code-corps-api/pull/455.diff","patch_url":"https://github.com/code-corps/code-corps-api/pull/455.patch","issue_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/455","number":455,"state":"open","locked":false,"title":"Write policies and endpoints for StripeCustomer","user":{"login":"amyschools","id":19355893,"avatar_url":"https://avatars.githubusercontent.com/u/19355893?v=3","gravatar_id":"","url":"https://api.github.com/users/amyschools","html_url":"https://github.com/amyschools","followers_url":"https://api.github.com/users/amyschools/followers","following_url":"https://api.github.com/users/amyschools/following{/other_user}","gists_url":"https://api.github.com/users/amyschools/gists{/gist_id}","starred_url":"https://api.github.com/users/amyschools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amyschools/subscriptions","organizations_url":"https://api.github.com/users/amyschools/orgs","repos_url":"https://api.github.com/users/amyschools/repos","events_url":"https://api.github.com/users/amyschools/events{/privacy}","received_events_url":"https://api.github.com/users/amyschools/received_events","type":"User","site_admin":false},"body":"# What's in this PR?\r\n\r\nAdded Stripe Customer policy for `index(filter_by_id)` and `show` endpoints to ability.ex, stripe_customer_policy.ex, factory, and tests to stripe_customer_policy_test.\r\n\r\n## References\r\nProgress on: #453 \r\nProgress on: #447 \r\n","created_at":"2016-11-10T22:05:40Z","updated_at":"2016-11-20T08:25:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"280469b78a661940452fce3226c6b0905d724439","assignee":{"login":"begedin","id":1925540,"avatar_url":"https://avatars.githubusercontent.com/u/1925540?v=3","gravatar_id":"","url":"https://api.github.com/users/begedin","html_url":"https://github.com/begedin","followers_url":"https://api.github.com/users/begedin/followers","following_url":"https://api.github.com/users/begedin/following{/other_user}","gists_url":"https://api.github.com/users/begedin/gists{/gist_id}","starred_url":"https://api.github.com/users/begedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begedin/subscriptions","organizations_url":"https://api.github.com/users/begedin/orgs","repos_url":"https://api.github.com/users/begedin/repos","events_url":"https://api.github.com/users/begedin/events{/privacy}","received_events_url":"https://api.github.com/users/begedin/received_events","type":"User","site_admin":false},"assignees":[{"login":"begedin","id":1925540,"avatar_url":"https://avatars.githubusercontent.com/u/1925540?v=3","gravatar_id":"","url":"https://api.github.com/users/begedin","html_url":"https://github.com/begedin","followers_url":"https://api.github.com/users/begedin/followers","following_url":"https://api.github.com/users/begedin/following{/other_user}","gists_url":"https://api.github.com/users/begedin/gists{/gist_id}","starred_url":"https://api.github.com/users/begedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begedin/subscriptions","organizations_url":"https://api.github.com/users/begedin/orgs","repos_url":"https://api.github.com/users/begedin/repos","events_url":"https://api.github.com/users/begedin/events{/privacy}","received_events_url":"https://api.github.com/users/begedin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455/commits","review_comments_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455/comments","review_comment_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/455/comments","statuses_url":"https://api.github.com/repos/code-corps/code-corps-api/statuses/b482efdb3e7501b9f205dee3450f81dc76adf682","head":{"label":"code-corps:453-stripecustomer-policy","ref":"453-stripecustomer-policy","sha":"b482efdb3e7501b9f205dee3450f81dc76adf682","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":63497734,"name":"code-corps-api","full_name":"code-corps/code-corps-api","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-api","description":"Elixir/Phoenix API for Code Corps.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-api","forks_url":"https://api.github.com/repos/code-corps/code-corps-api/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-api/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-api/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-api/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-api/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-api/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-api/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-api/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-api/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-api/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-api/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-api/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-api/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-api/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-api/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-api/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-api/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-api/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-api/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-api/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-api/deployments","created_at":"2016-07-16T18:49:25Z","updated_at":"2016-11-19T21:43:47Z","pushed_at":"2016-11-20T06:35:49Z","git_url":"git://github.com/code-corps/code-corps-api.git","ssh_url":"git@github.com:code-corps/code-corps-api.git","clone_url":"https://github.com/code-corps/code-corps-api.git","svn_url":"https://github.com/code-corps/code-corps-api","homepage":"https://www.codecorps.org","size":856,"stargazers_count":81,"watchers_count":81,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":73,"forks":27,"open_issues":73,"watchers":81,"default_branch":"develop"}},"base":{"label":"code-corps:develop","ref":"develop","sha":"7ebaf311922e7cb2e43111a2c69e56b1b1da4b90","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":63497734,"name":"code-corps-api","full_name":"code-corps/code-corps-api","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-api","description":"Elixir/Phoenix API for Code Corps.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-api","forks_url":"https://api.github.com/repos/code-corps/code-corps-api/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-api/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-api/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-api/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-api/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-api/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-api/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-api/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-api/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-api/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-api/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-api/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-api/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-api/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-api/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-api/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-api/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-api/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-api/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-api/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-api/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-api/deployments","created_at":"2016-07-16T18:49:25Z","updated_at":"2016-11-19T21:43:47Z","pushed_at":"2016-11-20T06:35:49Z","git_url":"git://github.com/code-corps/code-corps-api.git","ssh_url":"git@github.com:code-corps/code-corps-api.git","clone_url":"https://github.com/code-corps/code-corps-api.git","svn_url":"https://github.com/code-corps/code-corps-api","homepage":"https://www.codecorps.org","size":856,"stargazers_count":81,"watchers_count":81,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":73,"forks":27,"open_issues":73,"watchers":81,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455"},"html":{"href":"https://github.com/code-corps/code-corps-api/pull/455"},"issue":{"href":"https://api.github.com/repos/code-corps/code-corps-api/issues/455"},"comments":{"href":"https://api.github.com/repos/code-corps/code-corps-api/issues/455/comments"},"review_comments":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455/comments"},"review_comment":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-corps/code-corps-api/pulls/455/commits"},"statuses":{"href":"https://api.github.com/repos/code-corps/code-corps-api/statuses/b482efdb3e7501b9f205dee3450f81dc76adf682"}}}}
{"actor":{"display_login":"JoshSmith"}}