{"action":"created","comment":{"url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/comments/52521852","id":52521852,"diff_hunk":"@@ -0,0 +1,74 @@\n+request = require('request')\n+azure = require('azure')\n+\n+websiteName = \"syncer-gbpglobal\" + if process.env.NODE_ENV is \"production\" then \"\" else \"-#{process.env.NODE_ENV}\"\n+notificationsUrl =\n+  if process.env.NODE_ENV is \"\"\n+    \"http://localhost:9001/api/hooks/webjob\"\n+  else\n+    process.env.NOTIFICATIONS_URL or \"http://#{websiteName}.azurewebsites.net/api/hooks/webjob\"\n+\n+connectionString = \"Endpoint=sb://producteca.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=euLNZQTHaw81dzv29Z+paA4GAlbf+5LfduwY5c9ULGs=\"\n+topic = 'salesorder'\n+subscription = \"syncer-gbpglobal/$DeadLetterQueue\"\n+\n+class ServiceBusReceiver\n+  constructor: (connectionString, @topic, @subscription) ->\n+    @serviceBusService = azure.createServiceBusService connectionString\n+\n+  run: =>\n+    @_createSubscription (error) =>\n+      if !error","path":"App_Data/jobs/continuous/ordershook-deadletter/run.coffee","position":21,"original_position":21,"commit_id":"f3a894acbfee83f5f4d487c8385fd349d867bf98","original_commit_id":"f3a894acbfee83f5f4d487c8385fd349d867bf98","user":{"login":"NahuelP","id":7072017,"avatar_url":"https://avatars.githubusercontent.com/u/7072017?v=3","gravatar_id":"","url":"https://api.github.com/users/NahuelP","html_url":"https://github.com/NahuelP","followers_url":"https://api.github.com/users/NahuelP/followers","following_url":"https://api.github.com/users/NahuelP/following{/other_user}","gists_url":"https://api.github.com/users/NahuelP/gists{/gist_id}","starred_url":"https://api.github.com/users/NahuelP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NahuelP/subscriptions","organizations_url":"https://api.github.com/users/NahuelP/orgs","repos_url":"https://api.github.com/users/NahuelP/repos","events_url":"https://api.github.com/users/NahuelP/events{/privacy}","received_events_url":"https://api.github.com/users/NahuelP/received_events","type":"User","site_admin":false},"body":"Jaajaj me gusta! Creo que `promisy`ando el _serviceBusService_ en el constructor y llamando al `createSubscriptionAsync` basta","created_at":"2016-02-10T20:44:32Z","updated_at":"2016-02-10T20:44:32Z","html_url":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4#discussion_r52521852","pull_request_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/comments/52521852"},"html":{"href":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4#discussion_r52521852"},"pull_request":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4","id":58343874,"html_url":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4","diff_url":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4.diff","patch_url":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4.patch","issue_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/4","number":4,"state":"open","locked":false,"title":"Invoice via notificaciones en GBP","user":{"login":"rodri042","id":1631752,"avatar_url":"https://avatars.githubusercontent.com/u/1631752?v=3","gravatar_id":"","url":"https://api.github.com/users/rodri042","html_url":"https://github.com/rodri042","followers_url":"https://api.github.com/users/rodri042/followers","following_url":"https://api.github.com/users/rodri042/following{/other_user}","gists_url":"https://api.github.com/users/rodri042/gists{/gist_id}","starred_url":"https://api.github.com/users/rodri042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodri042/subscriptions","organizations_url":"https://api.github.com/users/rodri042/orgs","repos_url":"https://api.github.com/users/rodri042/repos","events_url":"https://api.github.com/users/rodri042/events{/privacy}","received_events_url":"https://api.github.com/users/rodri042/received_events","type":"User","site_admin":false},"body":"[Finishes #112325555](https://www.pivotaltracker.com/story/show/112325555)\r\n\r\nComo cada cliente facturaba distintas ordenes (algunos \"las pagadas\", otros \"las pagadas con envío pendiente\", otros \"todas a partir de cierta fecha\", etc), para que no haya quilombos hice que se configure por cada uno un *cacho de javascript* que determine si esa orden va o no va.\r\nCon esto dejaríamos de tener un job por cada cliente.\r\n\r\n# No mergear, yo mergeo\r\n###### (mergea a `#costo-envio-en-pagos` y después a `#development`)","created_at":"2016-02-04T20:27:48Z","updated_at":"2016-02-10T20:44:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a69609494e3adfec4684e8765f718a2ff08334be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/4/comments","statuses_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/statuses/f3a894acbfee83f5f4d487c8385fd349d867bf98","head":{"label":"Parsimotion:invoice-via-notificaciones","ref":"invoice-via-notificaciones","sha":"f3a894acbfee83f5f4d487c8385fd349d867bf98","user":{"login":"Parsimotion","id":8582957,"avatar_url":"https://avatars.githubusercontent.com/u/8582957?v=3","gravatar_id":"","url":"https://api.github.com/users/Parsimotion","html_url":"https://github.com/Parsimotion","followers_url":"https://api.github.com/users/Parsimotion/followers","following_url":"https://api.github.com/users/Parsimotion/following{/other_user}","gists_url":"https://api.github.com/users/Parsimotion/gists{/gist_id}","starred_url":"https://api.github.com/users/Parsimotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parsimotion/subscriptions","organizations_url":"https://api.github.com/users/Parsimotion/orgs","repos_url":"https://api.github.com/users/Parsimotion/repos","events_url":"https://api.github.com/users/Parsimotion/events{/privacy}","received_events_url":"https://api.github.com/users/Parsimotion/received_events","type":"Organization","site_admin":false},"repo":{"id":43913527,"name":"syncer-gbpglobal","full_name":"Parsimotion/syncer-gbpglobal","owner":{"login":"Parsimotion","id":8582957,"avatar_url":"https://avatars.githubusercontent.com/u/8582957?v=3","gravatar_id":"","url":"https://api.github.com/users/Parsimotion","html_url":"https://github.com/Parsimotion","followers_url":"https://api.github.com/users/Parsimotion/followers","following_url":"https://api.github.com/users/Parsimotion/following{/other_user}","gists_url":"https://api.github.com/users/Parsimotion/gists{/gist_id}","starred_url":"https://api.github.com/users/Parsimotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parsimotion/subscriptions","organizations_url":"https://api.github.com/users/Parsimotion/orgs","repos_url":"https://api.github.com/users/Parsimotion/repos","events_url":"https://api.github.com/users/Parsimotion/events{/privacy}","received_events_url":"https://api.github.com/users/Parsimotion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Parsimotion/syncer-gbpglobal","description":"Syncer between GBP users and Producteca.","fork":false,"url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal","forks_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/forks","keys_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/teams","hooks_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/hooks","issue_events_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/events{/number}","events_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/events","assignees_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/assignees{/user}","branches_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/branches{/branch}","tags_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/tags","blobs_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/statuses/{sha}","languages_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/languages","stargazers_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/stargazers","contributors_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/contributors","subscribers_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/subscribers","subscription_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/subscription","commits_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/contents/{+path}","compare_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/merges","archive_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/downloads","issues_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues{/number}","pulls_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls{/number}","milestones_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/milestones{/number}","notifications_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/labels{/name}","releases_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/releases{/id}","deployments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/deployments","created_at":"2015-10-08T20:05:56Z","updated_at":"2016-01-20T19:44:37Z","pushed_at":"2016-02-05T19:28:53Z","git_url":"git://github.com/Parsimotion/syncer-gbpglobal.git","ssh_url":"git@github.com:Parsimotion/syncer-gbpglobal.git","clone_url":"https://github.com/Parsimotion/syncer-gbpglobal.git","svn_url":"https://github.com/Parsimotion/syncer-gbpglobal","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":0,"default_branch":"development"}},"base":{"label":"Parsimotion:costo-envio-en-pagos","ref":"costo-envio-en-pagos","sha":"afb9ba4e6fd58adef00593a773d675c896d71c8d","user":{"login":"Parsimotion","id":8582957,"avatar_url":"https://avatars.githubusercontent.com/u/8582957?v=3","gravatar_id":"","url":"https://api.github.com/users/Parsimotion","html_url":"https://github.com/Parsimotion","followers_url":"https://api.github.com/users/Parsimotion/followers","following_url":"https://api.github.com/users/Parsimotion/following{/other_user}","gists_url":"https://api.github.com/users/Parsimotion/gists{/gist_id}","starred_url":"https://api.github.com/users/Parsimotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parsimotion/subscriptions","organizations_url":"https://api.github.com/users/Parsimotion/orgs","repos_url":"https://api.github.com/users/Parsimotion/repos","events_url":"https://api.github.com/users/Parsimotion/events{/privacy}","received_events_url":"https://api.github.com/users/Parsimotion/received_events","type":"Organization","site_admin":false},"repo":{"id":43913527,"name":"syncer-gbpglobal","full_name":"Parsimotion/syncer-gbpglobal","owner":{"login":"Parsimotion","id":8582957,"avatar_url":"https://avatars.githubusercontent.com/u/8582957?v=3","gravatar_id":"","url":"https://api.github.com/users/Parsimotion","html_url":"https://github.com/Parsimotion","followers_url":"https://api.github.com/users/Parsimotion/followers","following_url":"https://api.github.com/users/Parsimotion/following{/other_user}","gists_url":"https://api.github.com/users/Parsimotion/gists{/gist_id}","starred_url":"https://api.github.com/users/Parsimotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parsimotion/subscriptions","organizations_url":"https://api.github.com/users/Parsimotion/orgs","repos_url":"https://api.github.com/users/Parsimotion/repos","events_url":"https://api.github.com/users/Parsimotion/events{/privacy}","received_events_url":"https://api.github.com/users/Parsimotion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Parsimotion/syncer-gbpglobal","description":"Syncer between GBP users and Producteca.","fork":false,"url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal","forks_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/forks","keys_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/teams","hooks_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/hooks","issue_events_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/events{/number}","events_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/events","assignees_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/assignees{/user}","branches_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/branches{/branch}","tags_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/tags","blobs_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/statuses/{sha}","languages_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/languages","stargazers_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/stargazers","contributors_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/contributors","subscribers_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/subscribers","subscription_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/subscription","commits_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/contents/{+path}","compare_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/merges","archive_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/downloads","issues_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues{/number}","pulls_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls{/number}","milestones_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/milestones{/number}","notifications_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/labels{/name}","releases_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/releases{/id}","deployments_url":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/deployments","created_at":"2015-10-08T20:05:56Z","updated_at":"2016-01-20T19:44:37Z","pushed_at":"2016-02-05T19:28:53Z","git_url":"git://github.com/Parsimotion/syncer-gbpglobal.git","ssh_url":"git@github.com:Parsimotion/syncer-gbpglobal.git","clone_url":"https://github.com/Parsimotion/syncer-gbpglobal.git","svn_url":"https://github.com/Parsimotion/syncer-gbpglobal","homepage":null,"size":210,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":0,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4"},"html":{"href":"https://github.com/Parsimotion/syncer-gbpglobal/pull/4"},"issue":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/4"},"comments":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Parsimotion/syncer-gbpglobal/statuses/f3a894acbfee83f5f4d487c8385fd349d867bf98"}}}}