{"action":"created","comment":{"url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/comments/37908608","id":37908608,"diff_hunk":"@@ -0,0 +1,131 @@\n+mimecontent = require('mime-content')\n+parseXml = require('./common').parseXml\n+val = require('./common').val\n+parseMatchType = require('./common').parseMatchType\n+parseAddressErrorStatus = require('./common').parseAddressErrorStatus\n+partnerId = process.env.EXPERIAN_PARTNER_ID\n+clientId = process.env.EXPERIAN_CLIENT_ID\n+\n+#\n+# Request Function -------------------------------------------------------\n+#\n+request = (vars) ->\n+\n+  body = \"\"\"\n+        <ELSGenericMessage> \n+          <CUSTOMER>\n+            <PARTNER_ID>partnerId</PARTNER_ID>\n+            <CLIENT_ID>clientId</CLIENT_ID>\n+            <CUST_REF_NO>999</CUST_REF_NO>\n+          </CUSTOMER> \n+          <LEAD_TRANS_DETAILS>\n+            <FIRST_NAME>#{val vars.lead.first_name}</FIRST_NAME>\n+            <LAST_NAME>#{val vars.lead.last_name}</LAST_NAME> \n+          </LEAD_TRANS_DETAILS>\n+          <LEAD_PHONE>\n+            <PHONE_TYPE>Home</PHONE_TYPE> \n+            <PHONE_NUMBER>#{val vars.lead.phone_number}</PHONE_NUMBER>\n+            <PHONE_EXTENSION/>\n+            <PHONE_COUNTRY_CODE>01</PHONE_COUNTRY_CODE> \n+          </LEAD_PHONE>\n+          <LEAD_ADDRESS>\n+            <ADDRESS_TYPE>Home</ADDRESS_TYPE> \n+            <STREET1>#{val vars.lead.address_1}</STREET1> \n+            <STREET2>#{val vars.lead.address_2}</STREET2> \n+            <CITY>#{val vars.lead.city}</CITY> \n+            <STATE>#{val vars.lead.state}</STATE>\n+            <ZIP>#{val vars.lead.postal_code}</ZIP>\n+            <COUNTRY>US</COUNTRY>\n+          </LEAD_ADDRESS>\n+        </ELSGenericMessage>\n+         \"\"\"\n+\n+  request_object =\n+    url:    'https://els.experianinteractive.com/els/action'\n+    method: 'POST'\n+    headers:\n+      Accept:           'text/xml'\n+      'Content-Type':   'text/xml'\n+      'Content-Length': body.length\n+    body: body \n+  return request_object\n+\n+#\n+# Request Function -------------------------------------------------------\n+#\n+request.variables = ->\n+  [\n+    { name: 'lead.first_name', type: 'string', description: 'first name', required: true }\n+    { name: 'lead.last_name', type: 'string', description: 'last name', required: true }\n+    { name: 'lead.phone_number', type: 'string', description: 'home phone number', required: false }\n+    { name: 'lead.address_1', type: 'string', description: 'street address', required: true }\n+    { name: 'lead.address_2', type: 'string', description: 'second line of street address, ie apt number', required: false }\n+    { name: 'lead.city', type: 'string', description: 'city', required: true }\n+    { name: 'lead.state', type: 'state', description: 'state', required: true }\n+    { name: 'lead.postal_code', type: 'postal_code', description: 'postal_code', required: true }\n+  ]\n+\n+#\n+# Validate Function ------------------------------------------------------\n+#\n+\n+validate = (vars) ->\n+  return 'address_1 must not be blank' unless vars.lead.address_1\n+  return 'city must not be blank' unless vars.lead.city\n+  return 'state must not be blank' unless vars.lead.state\n+  return 'postal_code must not be blank' unless vars.lead.postal_code\n+\n+#\n+# Response Function ------------------------------------------------------\n+#\n+\n+response = (vars, req, res) ->\n+  body = parseXml(res.body)\n+  value = parseValue(body.Stage2Data?.Livu?.ESTIMATED_CURRENT_HOME_VALUE)\n+  homeValueLookupRes = {}","path":"src/home_value_lookup.coffee","position":85,"original_position":85,"commit_id":"e7062b4b73411f025331e2feb874cc9738e4ee24","original_commit_id":"e7062b4b73411f025331e2feb874cc9738e4ee24","user":{"login":"alexkwolfe","id":569,"avatar_url":"https://avatars.githubusercontent.com/u/569?v=3","gravatar_id":"","url":"https://api.github.com/users/alexkwolfe","html_url":"https://github.com/alexkwolfe","followers_url":"https://api.github.com/users/alexkwolfe/followers","following_url":"https://api.github.com/users/alexkwolfe/following{/other_user}","gists_url":"https://api.github.com/users/alexkwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkwolfe/subscriptions","organizations_url":"https://api.github.com/users/alexkwolfe/orgs","repos_url":"https://api.github.com/users/alexkwolfe/repos","events_url":"https://api.github.com/users/alexkwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/alexkwolfe/received_events","type":"User","site_admin":false},"body":"Again, this is a style issue, but a shorter variable name could be just as descriptive and less verbose.","created_at":"2015-08-25T19:33:19Z","updated_at":"2015-08-25T19:33:19Z","html_url":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16#discussion_r37908608","pull_request_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/comments/37908608"},"html":{"href":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16#discussion_r37908608"},"pull_request":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16","id":43195246,"html_url":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16","diff_url":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16.diff","patch_url":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16.patch","issue_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/16","number":16,"state":"open","locked":false,"title":"Home value","user":{"login":"ros3bud","id":3402403,"avatar_url":"https://avatars.githubusercontent.com/u/3402403?v=3","gravatar_id":"","url":"https://api.github.com/users/ros3bud","html_url":"https://github.com/ros3bud","followers_url":"https://api.github.com/users/ros3bud/followers","following_url":"https://api.github.com/users/ros3bud/following{/other_user}","gists_url":"https://api.github.com/users/ros3bud/gists{/gist_id}","starred_url":"https://api.github.com/users/ros3bud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros3bud/subscriptions","organizations_url":"https://api.github.com/users/ros3bud/orgs","repos_url":"https://api.github.com/users/ros3bud/repos","events_url":"https://api.github.com/users/ros3bud/events{/privacy}","received_events_url":"https://api.github.com/users/ros3bud/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-24T16:41:48Z","updated_at":"2015-08-25T19:33:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"871769011791445fea7796e46beb08f0f5b3e60a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16/commits","review_comments_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16/comments","review_comment_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/16/comments","statuses_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/statuses/e7062b4b73411f025331e2feb874cc9738e4ee24","head":{"label":"activeprospect:home_value","ref":"home_value","sha":"e7062b4b73411f025331e2feb874cc9738e4ee24","user":{"login":"activeprospect","id":245554,"avatar_url":"https://avatars.githubusercontent.com/u/245554?v=3","gravatar_id":"","url":"https://api.github.com/users/activeprospect","html_url":"https://github.com/activeprospect","followers_url":"https://api.github.com/users/activeprospect/followers","following_url":"https://api.github.com/users/activeprospect/following{/other_user}","gists_url":"https://api.github.com/users/activeprospect/gists{/gist_id}","starred_url":"https://api.github.com/users/activeprospect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeprospect/subscriptions","organizations_url":"https://api.github.com/users/activeprospect/orgs","repos_url":"https://api.github.com/users/activeprospect/repos","events_url":"https://api.github.com/users/activeprospect/events{/privacy}","received_events_url":"https://api.github.com/users/activeprospect/received_events","type":"Organization","site_admin":false},"repo":{"id":34917909,"name":"leadconduit-integration-experian","full_name":"activeprospect/leadconduit-integration-experian","owner":{"login":"activeprospect","id":245554,"avatar_url":"https://avatars.githubusercontent.com/u/245554?v=3","gravatar_id":"","url":"https://api.github.com/users/activeprospect","html_url":"https://github.com/activeprospect","followers_url":"https://api.github.com/users/activeprospect/followers","following_url":"https://api.github.com/users/activeprospect/following{/other_user}","gists_url":"https://api.github.com/users/activeprospect/gists{/gist_id}","starred_url":"https://api.github.com/users/activeprospect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeprospect/subscriptions","organizations_url":"https://api.github.com/users/activeprospect/orgs","repos_url":"https://api.github.com/users/activeprospect/repos","events_url":"https://api.github.com/users/activeprospect/events{/privacy}","received_events_url":"https://api.github.com/users/activeprospect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/activeprospect/leadconduit-integration-experian","description":"","fork":false,"url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian","forks_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/forks","keys_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/teams","hooks_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/hooks","issue_events_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/events{/number}","events_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/events","assignees_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/assignees{/user}","branches_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/branches{/branch}","tags_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/tags","blobs_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/refs{/sha}","trees_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/statuses/{sha}","languages_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/languages","stargazers_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/stargazers","contributors_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/contributors","subscribers_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/subscribers","subscription_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/subscription","commits_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/commits{/sha}","git_commits_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/commits{/sha}","comments_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/comments{/number}","issue_comment_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/comments{/number}","contents_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/contents/{+path}","compare_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/merges","archive_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/downloads","issues_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues{/number}","pulls_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls{/number}","milestones_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/milestones{/number}","notifications_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/labels{/name}","releases_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/releases{/id}","created_at":"2015-05-01T18:42:41Z","updated_at":"2015-05-07T22:22:13Z","pushed_at":"2015-08-25T18:47:02Z","git_url":"git://github.com/activeprospect/leadconduit-integration-experian.git","ssh_url":"git@github.com:activeprospect/leadconduit-integration-experian.git","clone_url":"https://github.com/activeprospect/leadconduit-integration-experian.git","svn_url":"https://github.com/activeprospect/leadconduit-integration-experian","homepage":null,"size":312,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"activeprospect:master","ref":"master","sha":"2f7980ab78cf0dc70f73dac154b9443e7e5e8523","user":{"login":"activeprospect","id":245554,"avatar_url":"https://avatars.githubusercontent.com/u/245554?v=3","gravatar_id":"","url":"https://api.github.com/users/activeprospect","html_url":"https://github.com/activeprospect","followers_url":"https://api.github.com/users/activeprospect/followers","following_url":"https://api.github.com/users/activeprospect/following{/other_user}","gists_url":"https://api.github.com/users/activeprospect/gists{/gist_id}","starred_url":"https://api.github.com/users/activeprospect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeprospect/subscriptions","organizations_url":"https://api.github.com/users/activeprospect/orgs","repos_url":"https://api.github.com/users/activeprospect/repos","events_url":"https://api.github.com/users/activeprospect/events{/privacy}","received_events_url":"https://api.github.com/users/activeprospect/received_events","type":"Organization","site_admin":false},"repo":{"id":34917909,"name":"leadconduit-integration-experian","full_name":"activeprospect/leadconduit-integration-experian","owner":{"login":"activeprospect","id":245554,"avatar_url":"https://avatars.githubusercontent.com/u/245554?v=3","gravatar_id":"","url":"https://api.github.com/users/activeprospect","html_url":"https://github.com/activeprospect","followers_url":"https://api.github.com/users/activeprospect/followers","following_url":"https://api.github.com/users/activeprospect/following{/other_user}","gists_url":"https://api.github.com/users/activeprospect/gists{/gist_id}","starred_url":"https://api.github.com/users/activeprospect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeprospect/subscriptions","organizations_url":"https://api.github.com/users/activeprospect/orgs","repos_url":"https://api.github.com/users/activeprospect/repos","events_url":"https://api.github.com/users/activeprospect/events{/privacy}","received_events_url":"https://api.github.com/users/activeprospect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/activeprospect/leadconduit-integration-experian","description":"","fork":false,"url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian","forks_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/forks","keys_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/teams","hooks_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/hooks","issue_events_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/events{/number}","events_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/events","assignees_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/assignees{/user}","branches_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/branches{/branch}","tags_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/tags","blobs_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/refs{/sha}","trees_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/statuses/{sha}","languages_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/languages","stargazers_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/stargazers","contributors_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/contributors","subscribers_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/subscribers","subscription_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/subscription","commits_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/commits{/sha}","git_commits_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/git/commits{/sha}","comments_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/comments{/number}","issue_comment_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/comments{/number}","contents_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/contents/{+path}","compare_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/merges","archive_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/downloads","issues_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues{/number}","pulls_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls{/number}","milestones_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/milestones{/number}","notifications_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/labels{/name}","releases_url":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/releases{/id}","created_at":"2015-05-01T18:42:41Z","updated_at":"2015-05-07T22:22:13Z","pushed_at":"2015-08-25T18:47:02Z","git_url":"git://github.com/activeprospect/leadconduit-integration-experian.git","ssh_url":"git@github.com:activeprospect/leadconduit-integration-experian.git","clone_url":"https://github.com/activeprospect/leadconduit-integration-experian.git","svn_url":"https://github.com/activeprospect/leadconduit-integration-experian","homepage":null,"size":312,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16"},"html":{"href":"https://github.com/activeprospect/leadconduit-integration-experian/pull/16"},"issue":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/16"},"comments":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/activeprospect/leadconduit-integration-experian/statuses/e7062b4b73411f025331e2feb874cc9738e4ee24"}}}}