{"action":"created","comment":{"url":"https://api.github.com/repos/PressLabs/silver/pulls/comments/94015329","pull_request_review_id":14545037,"id":94015329,"diff_hunk":"@@ -160,21 +151,46 @@ def _charge_transaction(self, transaction):\n             'billing': {\n                 'postal_code': payment_method.data.get('postal_code')\n             },\n-            'cardholder_name': payment_method.data.get('cardholder_name'),\n+            # TODO check how firstname and lastname can be obtained (for both\n+            # credit card and paypal)\n             'options': {\n                 'submit_for_settlement': True,\n-                \"store_in_vault_on_success\": payment_method.is_recurring\n+                \"store_in_vault\": payment_method.is_recurring\n             },\n         })\n \n+        customer = transaction.customer\n+        if 'braintree_id' in customer.meta:\n+            data.update({\n+                'customer_id': customer.meta['braintree_id']\n+            })\n+        else:\n+            data.update({\n+                'customer': {\n+                    'first_name': customer.name,\n+                    # TODO split silver customer name field into first and last.\n+                    # This should've been obvious from the very start\n+                }\n+            })\n+\n         # send transaction request\n         result = braintree.Transaction.sale(data)\n \n         # handle response\n         if result.is_success and result.transaction:\n-            self._update_payment_method(payment_method,\n-                                        result.transaction.payment_method)\n+            self._update_customer(customer, result.transaction.customer_details)\n+\n+            type = result.transaction.payment_instrument_type","path":"payment_processors/braintree_processor/models/payment_processors.py","position":172,"original_position":172,"commit_id":"54c4aacbb8a18f7a6bf326fee2ba4e61431f36a6","original_commit_id":"54c4aacbb8a18f7a6bf326fee2ba4e61431f36a6","user":{"login":"vtemian","id":639771,"avatar_url":"https://avatars.githubusercontent.com/u/639771?v=3","gravatar_id":"","url":"https://api.github.com/users/vtemian","html_url":"https://github.com/vtemian","followers_url":"https://api.github.com/users/vtemian/followers","following_url":"https://api.github.com/users/vtemian/following{/other_user}","gists_url":"https://api.github.com/users/vtemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vtemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtemian/subscriptions","organizations_url":"https://api.github.com/users/vtemian/orgs","repos_url":"https://api.github.com/users/vtemian/repos","events_url":"https://api.github.com/users/vtemian/events{/privacy}","received_events_url":"https://api.github.com/users/vtemian/received_events","type":"User","site_admin":false},"body":"Same as above.","created_at":"2016-12-28T10:08:11Z","updated_at":"2016-12-28T10:08:53Z","html_url":"https://github.com/PressLabs/silver/pull/399#discussion_r94015329","pull_request_url":"https://api.github.com/repos/PressLabs/silver/pulls/399","_links":{"self":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/comments/94015329"},"html":{"href":"https://github.com/PressLabs/silver/pull/399#discussion_r94015329"},"pull_request":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/399"}}},"pull_request":{"url":"https://api.github.com/repos/PressLabs/silver/pulls/399","id":99461735,"html_url":"https://github.com/PressLabs/silver/pull/399","diff_url":"https://github.com/PressLabs/silver/pull/399.diff","patch_url":"https://github.com/PressLabs/silver/pull/399.patch","issue_url":"https://api.github.com/repos/PressLabs/silver/issues/399","number":399,"state":"open","locked":false,"title":"Further work on Braintree.","user":{"login":"bogdanpetrea","id":8372264,"avatar_url":"https://avatars.githubusercontent.com/u/8372264?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanpetrea","html_url":"https://github.com/bogdanpetrea","followers_url":"https://api.github.com/users/bogdanpetrea/followers","following_url":"https://api.github.com/users/bogdanpetrea/following{/other_user}","gists_url":"https://api.github.com/users/bogdanpetrea/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanpetrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanpetrea/subscriptions","organizations_url":"https://api.github.com/users/bogdanpetrea/orgs","repos_url":"https://api.github.com/users/bogdanpetrea/repos","events_url":"https://api.github.com/users/bogdanpetrea/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanpetrea/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-27T16:33:02Z","updated_at":"2016-12-28T10:08:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7090bdd59f7ccb499e196bbeea3872627b0ba2d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PressLabs/silver/pulls/399/commits","review_comments_url":"https://api.github.com/repos/PressLabs/silver/pulls/399/comments","review_comment_url":"https://api.github.com/repos/PressLabs/silver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PressLabs/silver/issues/399/comments","statuses_url":"https://api.github.com/repos/PressLabs/silver/statuses/54c4aacbb8a18f7a6bf326fee2ba4e61431f36a6","head":{"label":"PressLabs:braintree","ref":"braintree","sha":"54c4aacbb8a18f7a6bf326fee2ba4e61431f36a6","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":24887812,"name":"silver","full_name":"PressLabs/silver","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/silver","description":"Django app + RESTful API for automatic billing","fork":false,"url":"https://api.github.com/repos/PressLabs/silver","forks_url":"https://api.github.com/repos/PressLabs/silver/forks","keys_url":"https://api.github.com/repos/PressLabs/silver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/silver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/silver/teams","hooks_url":"https://api.github.com/repos/PressLabs/silver/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/silver/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/silver/events","assignees_url":"https://api.github.com/repos/PressLabs/silver/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/silver/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/silver/tags","blobs_url":"https://api.github.com/repos/PressLabs/silver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/silver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/silver/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/silver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/silver/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/silver/languages","stargazers_url":"https://api.github.com/repos/PressLabs/silver/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/silver/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/silver/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/silver/subscription","commits_url":"https://api.github.com/repos/PressLabs/silver/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/silver/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/silver/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/silver/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/silver/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/silver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/silver/merges","archive_url":"https://api.github.com/repos/PressLabs/silver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/silver/downloads","issues_url":"https://api.github.com/repos/PressLabs/silver/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/silver/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/silver/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/silver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/silver/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/silver/releases{/id}","deployments_url":"https://api.github.com/repos/PressLabs/silver/deployments","created_at":"2014-10-07T11:39:38Z","updated_at":"2016-12-27T04:24:00Z","pushed_at":"2016-12-28T09:20:13Z","git_url":"git://github.com/PressLabs/silver.git","ssh_url":"git@github.com:PressLabs/silver.git","clone_url":"https://github.com/PressLabs/silver.git","svn_url":"https://github.com/PressLabs/silver","homepage":"https://www.presslabs.com/silver/","size":1761,"stargazers_count":84,"watchers_count":84,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":52,"forks":14,"open_issues":52,"watchers":84,"default_branch":"master"}},"base":{"label":"PressLabs:master","ref":"master","sha":"6f7eb9f4ef4f4724c66ed5af201600b051108597","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":24887812,"name":"silver","full_name":"PressLabs/silver","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/silver","description":"Django app + RESTful API for automatic billing","fork":false,"url":"https://api.github.com/repos/PressLabs/silver","forks_url":"https://api.github.com/repos/PressLabs/silver/forks","keys_url":"https://api.github.com/repos/PressLabs/silver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/silver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/silver/teams","hooks_url":"https://api.github.com/repos/PressLabs/silver/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/silver/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/silver/events","assignees_url":"https://api.github.com/repos/PressLabs/silver/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/silver/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/silver/tags","blobs_url":"https://api.github.com/repos/PressLabs/silver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/silver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/silver/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/silver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/silver/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/silver/languages","stargazers_url":"https://api.github.com/repos/PressLabs/silver/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/silver/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/silver/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/silver/subscription","commits_url":"https://api.github.com/repos/PressLabs/silver/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/silver/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/silver/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/silver/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/silver/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/silver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/silver/merges","archive_url":"https://api.github.com/repos/PressLabs/silver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/silver/downloads","issues_url":"https://api.github.com/repos/PressLabs/silver/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/silver/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/silver/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/silver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/silver/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/silver/releases{/id}","deployments_url":"https://api.github.com/repos/PressLabs/silver/deployments","created_at":"2014-10-07T11:39:38Z","updated_at":"2016-12-27T04:24:00Z","pushed_at":"2016-12-28T09:20:13Z","git_url":"git://github.com/PressLabs/silver.git","ssh_url":"git@github.com:PressLabs/silver.git","clone_url":"https://github.com/PressLabs/silver.git","svn_url":"https://github.com/PressLabs/silver","homepage":"https://www.presslabs.com/silver/","size":1761,"stargazers_count":84,"watchers_count":84,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":52,"forks":14,"open_issues":52,"watchers":84,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/399"},"html":{"href":"https://github.com/PressLabs/silver/pull/399"},"issue":{"href":"https://api.github.com/repos/PressLabs/silver/issues/399"},"comments":{"href":"https://api.github.com/repos/PressLabs/silver/issues/399/comments"},"review_comments":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/399/comments"},"review_comment":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PressLabs/silver/pulls/399/commits"},"statuses":{"href":"https://api.github.com/repos/PressLabs/silver/statuses/54c4aacbb8a18f7a6bf326fee2ba4e61431f36a6"}}}}
{"actor":{"display_login":"vtemian"}}