{"action":"created","comment":{"url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/comments/80733700","pull_request_review_id":1768992,"id":80733700,"diff_hunk":"@@ -1,22 +1,31 @@\n 'use strict'\n \n const log = require('../services/log')('payments')\n-const receiver = require('../services/receiver')\n-const send = require('five-bells-sender').default\n+const ilp = require('ilp')\n+const FiveBellsLedger = require('ilp-plugin-bells')\n+const receiverSecret = 'O8Y6+6bJgl2i285yCeC/Wigi6P6TJ4C78tdASqDOR9g=' // XXX\n \n exports.put = function * () {\n   const body = this.request.body\n-  const receiverId = String(Math.floor(Math.random() * 0xffffffff))\n-  const condition = receiver.getConditionForLedger(body.destination_ledger, receiverId)\n-  const paymentArgs = {\n-    sourceAccount: body.source_ledger + '/accounts/' + encodeURIComponent(body.source_username),\n-    sourcePassword: body.source_password,\n-    destinationAccount: body.destination_ledger + '/accounts/' + encodeURIComponent(body.destination_username),\n-    destinationAmount: '1',\n-    receiptCondition: condition.getConditionUri(),\n-    destinationMemo: { receiverId }\n-  }\n-  log.debug('put payment:', paymentArgs)\n-  yield send(paymentArgs)\n-  this.body = paymentArgs\n+  const sourceAccountURI = body.source_ledger + '/accounts/' + encodeURIComponent(body.source_username)\n+  const destinationAccountURI = body.destination_ledger + '/accounts/' + encodeURIComponent(body.destination_username)\n+  const sender = ilp.createSender({\n+    _plugin: FiveBellsLedger,\n+    account: sourceAccountURI,\n+    password: body.source_password\n+  })\n+\n+  const receiver = ilp.createReceiver({\n+    _plugin: FiveBellsLedger,\n+    account: destinationAccountURI,\n+    password: body.destination_password,\n+    hmacKey: new Buffer(receiverSecret, 'base64')\n+  })\n+  yield receiver.listen()\n+\n+  const paymentRequest = receiver.createRequest({amount: '1'})\n+  const paymentParams = yield sender.quoteRequest(paymentRequest)\n+  log.debug('put payment:', paymentParams)\n+  const result = yield sender.payRequest(paymentParams)\n+  this.body = result","path":"controllers/payments.js","position":45,"original_position":45,"commit_id":"699e14d7da372a51273efb3c95bf7c02aeaa31b8","original_commit_id":"699e14d7da372a51273efb3c95bf7c02aeaa31b8","user":{"login":"emschwartz","id":3262610,"avatar_url":"https://avatars.githubusercontent.com/u/3262610?v=3","gravatar_id":"","url":"https://api.github.com/users/emschwartz","html_url":"https://github.com/emschwartz","followers_url":"https://api.github.com/users/emschwartz/followers","following_url":"https://api.github.com/users/emschwartz/following{/other_user}","gists_url":"https://api.github.com/users/emschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/emschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emschwartz/subscriptions","organizations_url":"https://api.github.com/users/emschwartz/orgs","repos_url":"https://api.github.com/users/emschwartz/repos","events_url":"https://api.github.com/users/emschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/emschwartz/received_events","type":"User","site_admin":false},"body":"Should probably call `receiver.stopListening` and `sender.stopListening`","created_at":"2016-09-27T16:21:51Z","updated_at":"2016-09-27T16:24:01Z","html_url":"https://github.com/interledger/five-bells-visualization/pull/33#discussion_r80733700","pull_request_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/comments/80733700"},"html":{"href":"https://github.com/interledger/five-bells-visualization/pull/33#discussion_r80733700"},"pull_request":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33","id":86962235,"html_url":"https://github.com/interledger/five-bells-visualization/pull/33","diff_url":"https://github.com/interledger/five-bells-visualization/pull/33.diff","patch_url":"https://github.com/interledger/five-bells-visualization/pull/33.patch","issue_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/33","number":33,"state":"open","locked":false,"title":"feat: [BREAKING] update deps; remove pathfinder, sender","user":{"login":"sentientwaffle","id":461112,"avatar_url":"https://avatars.githubusercontent.com/u/461112?v=3","gravatar_id":"","url":"https://api.github.com/users/sentientwaffle","html_url":"https://github.com/sentientwaffle","followers_url":"https://api.github.com/users/sentientwaffle/followers","following_url":"https://api.github.com/users/sentientwaffle/following{/other_user}","gists_url":"https://api.github.com/users/sentientwaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/sentientwaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sentientwaffle/subscriptions","organizations_url":"https://api.github.com/users/sentientwaffle/orgs","repos_url":"https://api.github.com/users/sentientwaffle/repos","events_url":"https://api.github.com/users/sentientwaffle/events{/privacy}","received_events_url":"https://api.github.com/users/sentientwaffle/received_events","type":"User","site_admin":false},"body":"Required by https://github.com/interledger/five-bells-demo/issues/34","created_at":"2016-09-27T16:12:56Z","updated_at":"2016-09-27T16:24:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cebdf3a7ccaf3fa8a4a6736e7fe7fb26ca9adcce","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33/commits","review_comments_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33/comments","review_comment_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/comments{/number}","comments_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/33/comments","statuses_url":"https://api.github.com/repos/interledger/five-bells-visualization/statuses/699e14d7da372a51273efb3c95bf7c02aeaa31b8","head":{"label":"interledger:dj-ilp-update","ref":"dj-ilp-update","sha":"699e14d7da372a51273efb3c95bf7c02aeaa31b8","user":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"repo":{"id":32615341,"name":"five-bells-visualization","full_name":"interledger/five-bells-visualization","owner":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/interledger/five-bells-visualization","description":"Tool to visualize Five Bells payments","fork":false,"url":"https://api.github.com/repos/interledger/five-bells-visualization","forks_url":"https://api.github.com/repos/interledger/five-bells-visualization/forks","keys_url":"https://api.github.com/repos/interledger/five-bells-visualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interledger/five-bells-visualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interledger/five-bells-visualization/teams","hooks_url":"https://api.github.com/repos/interledger/five-bells-visualization/hooks","issue_events_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/events{/number}","events_url":"https://api.github.com/repos/interledger/five-bells-visualization/events","assignees_url":"https://api.github.com/repos/interledger/five-bells-visualization/assignees{/user}","branches_url":"https://api.github.com/repos/interledger/five-bells-visualization/branches{/branch}","tags_url":"https://api.github.com/repos/interledger/five-bells-visualization/tags","blobs_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interledger/five-bells-visualization/statuses/{sha}","languages_url":"https://api.github.com/repos/interledger/five-bells-visualization/languages","stargazers_url":"https://api.github.com/repos/interledger/five-bells-visualization/stargazers","contributors_url":"https://api.github.com/repos/interledger/five-bells-visualization/contributors","subscribers_url":"https://api.github.com/repos/interledger/five-bells-visualization/subscribers","subscription_url":"https://api.github.com/repos/interledger/five-bells-visualization/subscription","commits_url":"https://api.github.com/repos/interledger/five-bells-visualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/interledger/five-bells-visualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/interledger/five-bells-visualization/contents/{+path}","compare_url":"https://api.github.com/repos/interledger/five-bells-visualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interledger/five-bells-visualization/merges","archive_url":"https://api.github.com/repos/interledger/five-bells-visualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interledger/five-bells-visualization/downloads","issues_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues{/number}","pulls_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls{/number}","milestones_url":"https://api.github.com/repos/interledger/five-bells-visualization/milestones{/number}","notifications_url":"https://api.github.com/repos/interledger/five-bells-visualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interledger/five-bells-visualization/labels{/name}","releases_url":"https://api.github.com/repos/interledger/five-bells-visualization/releases{/id}","deployments_url":"https://api.github.com/repos/interledger/five-bells-visualization/deployments","created_at":"2015-03-21T01:24:43Z","updated_at":"2016-04-27T07:43:00Z","pushed_at":"2016-09-27T16:12:57Z","git_url":"git://github.com/interledger/five-bells-visualization.git","ssh_url":"git@github.com:interledger/five-bells-visualization.git","clone_url":"https://github.com/interledger/five-bells-visualization.git","svn_url":"https://github.com/interledger/five-bells-visualization","homepage":"","size":150,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"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":3,"default_branch":"master"}},"base":{"label":"interledger:master","ref":"master","sha":"d6bd8450d48aa6ee5ecaecbf74d13e61f922ee91","user":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"repo":{"id":32615341,"name":"five-bells-visualization","full_name":"interledger/five-bells-visualization","owner":{"login":"interledger","id":14062960,"avatar_url":"https://avatars.githubusercontent.com/u/14062960?v=3","gravatar_id":"","url":"https://api.github.com/users/interledger","html_url":"https://github.com/interledger","followers_url":"https://api.github.com/users/interledger/followers","following_url":"https://api.github.com/users/interledger/following{/other_user}","gists_url":"https://api.github.com/users/interledger/gists{/gist_id}","starred_url":"https://api.github.com/users/interledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interledger/subscriptions","organizations_url":"https://api.github.com/users/interledger/orgs","repos_url":"https://api.github.com/users/interledger/repos","events_url":"https://api.github.com/users/interledger/events{/privacy}","received_events_url":"https://api.github.com/users/interledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/interledger/five-bells-visualization","description":"Tool to visualize Five Bells payments","fork":false,"url":"https://api.github.com/repos/interledger/five-bells-visualization","forks_url":"https://api.github.com/repos/interledger/five-bells-visualization/forks","keys_url":"https://api.github.com/repos/interledger/five-bells-visualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interledger/five-bells-visualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interledger/five-bells-visualization/teams","hooks_url":"https://api.github.com/repos/interledger/five-bells-visualization/hooks","issue_events_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/events{/number}","events_url":"https://api.github.com/repos/interledger/five-bells-visualization/events","assignees_url":"https://api.github.com/repos/interledger/five-bells-visualization/assignees{/user}","branches_url":"https://api.github.com/repos/interledger/five-bells-visualization/branches{/branch}","tags_url":"https://api.github.com/repos/interledger/five-bells-visualization/tags","blobs_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interledger/five-bells-visualization/statuses/{sha}","languages_url":"https://api.github.com/repos/interledger/five-bells-visualization/languages","stargazers_url":"https://api.github.com/repos/interledger/five-bells-visualization/stargazers","contributors_url":"https://api.github.com/repos/interledger/five-bells-visualization/contributors","subscribers_url":"https://api.github.com/repos/interledger/five-bells-visualization/subscribers","subscription_url":"https://api.github.com/repos/interledger/five-bells-visualization/subscription","commits_url":"https://api.github.com/repos/interledger/five-bells-visualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/interledger/five-bells-visualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/interledger/five-bells-visualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/interledger/five-bells-visualization/contents/{+path}","compare_url":"https://api.github.com/repos/interledger/five-bells-visualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interledger/five-bells-visualization/merges","archive_url":"https://api.github.com/repos/interledger/five-bells-visualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interledger/five-bells-visualization/downloads","issues_url":"https://api.github.com/repos/interledger/five-bells-visualization/issues{/number}","pulls_url":"https://api.github.com/repos/interledger/five-bells-visualization/pulls{/number}","milestones_url":"https://api.github.com/repos/interledger/five-bells-visualization/milestones{/number}","notifications_url":"https://api.github.com/repos/interledger/five-bells-visualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interledger/five-bells-visualization/labels{/name}","releases_url":"https://api.github.com/repos/interledger/five-bells-visualization/releases{/id}","deployments_url":"https://api.github.com/repos/interledger/five-bells-visualization/deployments","created_at":"2015-03-21T01:24:43Z","updated_at":"2016-04-27T07:43:00Z","pushed_at":"2016-09-27T16:12:57Z","git_url":"git://github.com/interledger/five-bells-visualization.git","ssh_url":"git@github.com:interledger/five-bells-visualization.git","clone_url":"https://github.com/interledger/five-bells-visualization.git","svn_url":"https://github.com/interledger/five-bells-visualization","homepage":"","size":150,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"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":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33"},"html":{"href":"https://github.com/interledger/five-bells-visualization/pull/33"},"issue":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/issues/33"},"comments":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/interledger/five-bells-visualization/statuses/699e14d7da372a51273efb3c95bf7c02aeaa31b8"}}}}
{"actor":{"display_login":"emschwartz"}}