{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/comments/29721366","id":29721366,"diff_hunk":"@@ -20,9 +21,35 @@ class Meta(Model.Meta):\n         db_table = 'buyer_braintree'\n \n     def get_uri(self):\n-        return reverse('braintree:buyer', kwargs={'pk': self.pk})\n+        return reverse('braintree:mozilla:buyer', kwargs={'pk': self.pk})\n \n     def save(self, *args, **kw):\n         if not self.pk:\n             self.braintree_id = str(self.buyer.pk)\n         return super(BraintreeBuyer, self).save(*args, **kw)\n+\n+\n+class BraintreePaymentMethod(Model):\n+\n+    \"\"\"A holder for braintree specific payment method.\"\"\"\n+\n+    active = models.BooleanField(default=True)\n+    braintree_buyer = models.ForeignKey(BraintreeBuyer)\n+    # An id specific to the provider.\n+    provider_id = models.CharField(max_length=255)\n+    # The type of payment method eg: card, paypal or bitcon\n+    type = models.PositiveIntegerField(choices=(\n+        (PAYMENT_METHOD_CARD, PAYMENT_METHOD_CARD),\n+    ))\n+    # Details about the type, eg Amex, Orange.\n+    type_name = models.CharField(max_length=255)\n+    # For credit cards, this is the last 4 numbers, could be a truncated\n+    # phone number or paypal account for example.\n+    truncated_id = models.CharField(max_length=255)","path":"lib/brains/models.py","position":37,"original_position":37,"commit_id":"ae0a30d4f170b74b44abbdc5c3a49fbb0b575f4d","original_commit_id":"ae0a30d4f170b74b44abbdc5c3a49fbb0b575f4d","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"Counter is on the base model, along with created, updated and the like: https://github.com/mozilla/solitude/blob/master/solitude/base.py#L279. I haven't figured out why we need it yet. I think its something to do with etags.","created_at":"2015-05-05T22:46:18Z","updated_at":"2015-05-05T22:46:18Z","html_url":"https://github.com/mozilla/solitude/pull/392#discussion_r29721366","pull_request_url":"https://api.github.com/repos/mozilla/solitude/pulls/392","_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments/29721366"},"html":{"href":"https://github.com/mozilla/solitude/pull/392#discussion_r29721366"},"pull_request":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/392","id":34513230,"html_url":"https://github.com/mozilla/solitude/pull/392","diff_url":"https://github.com/mozilla/solitude/pull/392.diff","patch_url":"https://github.com/mozilla/solitude/pull/392.patch","issue_url":"https://api.github.com/repos/mozilla/solitude/issues/392","number":392,"state":"open","locked":false,"title":"create a payment method api and model","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"Fixes mozilla/payments#17","created_at":"2015-05-01T00:18:24Z","updated_at":"2015-05-05T22:46:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9737bce33b7f102e891f25100a581ff883ce7502","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/solitude/pulls/392/commits","review_comments_url":"https://api.github.com/repos/mozilla/solitude/pulls/392/comments","review_comment_url":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/solitude/issues/392/comments","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/ae0a30d4f170b74b44abbdc5c3a49fbb0b575f4d","head":{"label":"andymckay:payment-method","ref":"payment-method","sha":"ae0a30d4f170b74b44abbdc5c3a49fbb0b575f4d","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"repo":{"id":23588659,"name":"solitude","full_name":"andymckay/solitude","owner":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andymckay/solitude","description":"A server for processing payments for Mozilla’s Marketplace and Add-ons site.","fork":true,"url":"https://api.github.com/repos/andymckay/solitude","forks_url":"https://api.github.com/repos/andymckay/solitude/forks","keys_url":"https://api.github.com/repos/andymckay/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andymckay/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andymckay/solitude/teams","hooks_url":"https://api.github.com/repos/andymckay/solitude/hooks","issue_events_url":"https://api.github.com/repos/andymckay/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/andymckay/solitude/events","assignees_url":"https://api.github.com/repos/andymckay/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/andymckay/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/andymckay/solitude/tags","blobs_url":"https://api.github.com/repos/andymckay/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andymckay/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andymckay/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/andymckay/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andymckay/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/andymckay/solitude/languages","stargazers_url":"https://api.github.com/repos/andymckay/solitude/stargazers","contributors_url":"https://api.github.com/repos/andymckay/solitude/contributors","subscribers_url":"https://api.github.com/repos/andymckay/solitude/subscribers","subscription_url":"https://api.github.com/repos/andymckay/solitude/subscription","commits_url":"https://api.github.com/repos/andymckay/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/andymckay/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/andymckay/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/andymckay/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/andymckay/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/andymckay/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andymckay/solitude/merges","archive_url":"https://api.github.com/repos/andymckay/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andymckay/solitude/downloads","issues_url":"https://api.github.com/repos/andymckay/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/andymckay/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/andymckay/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/andymckay/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andymckay/solitude/labels{/name}","releases_url":"https://api.github.com/repos/andymckay/solitude/releases{/id}","created_at":"2014-09-02T17:37:20Z","updated_at":"2015-04-19T15:06:31Z","pushed_at":"2015-05-05T22:16:12Z","git_url":"git://github.com/andymckay/solitude.git","ssh_url":"git@github.com:andymckay/solitude.git","clone_url":"https://github.com/andymckay/solitude.git","svn_url":"https://github.com/andymckay/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":3807,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"mozilla:master","ref":"master","sha":"b94922996083f0b1cdf7924c6c004e0f7e70489c","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":4566171,"name":"solitude","full_name":"mozilla/solitude","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/solitude","description":"A server for processing payments for Mozilla’s Marketplace.","fork":false,"url":"https://api.github.com/repos/mozilla/solitude","forks_url":"https://api.github.com/repos/mozilla/solitude/forks","keys_url":"https://api.github.com/repos/mozilla/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/solitude/teams","hooks_url":"https://api.github.com/repos/mozilla/solitude/hooks","issue_events_url":"https://api.github.com/repos/mozilla/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/solitude/events","assignees_url":"https://api.github.com/repos/mozilla/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/solitude/tags","blobs_url":"https://api.github.com/repos/mozilla/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/solitude/languages","stargazers_url":"https://api.github.com/repos/mozilla/solitude/stargazers","contributors_url":"https://api.github.com/repos/mozilla/solitude/contributors","subscribers_url":"https://api.github.com/repos/mozilla/solitude/subscribers","subscription_url":"https://api.github.com/repos/mozilla/solitude/subscription","commits_url":"https://api.github.com/repos/mozilla/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/solitude/merges","archive_url":"https://api.github.com/repos/mozilla/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/solitude/downloads","issues_url":"https://api.github.com/repos/mozilla/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/solitude/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/solitude/releases{/id}","created_at":"2012-06-05T22:13:53Z","updated_at":"2015-05-05T20:04:49Z","pushed_at":"2015-05-05T22:16:26Z","git_url":"git://github.com/mozilla/solitude.git","ssh_url":"git@github.com:mozilla/solitude.git","clone_url":"https://github.com/mozilla/solitude.git","svn_url":"https://github.com/mozilla/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":6961,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":16,"forks":26,"open_issues":16,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/392"},"html":{"href":"https://github.com/mozilla/solitude/pull/392"},"issue":{"href":"https://api.github.com/repos/mozilla/solitude/issues/392"},"comments":{"href":"https://api.github.com/repos/mozilla/solitude/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/solitude/statuses/ae0a30d4f170b74b44abbdc5c3a49fbb0b575f4d"}}}}