{"action":"created","comment":{"url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/comments/72346038","id":72346038,"diff_hunk":"@@ -20,6 +26,25 @@ var del = find.del;\n exports.track = function(track){\n   var payload = common(track);\n   payload.revenue = track.revenue();\n+\n+  // only set price and quantity if both exist\n+  var price = getRevenueField(track, 'price');\n+  var quantity = track.quantity();\n+  if (price && quantity) {\n+    payload.price = price;\n+    payload.quantity = quantity;\n+  }\n+\n+  // additional revenue fields\n+  var revenueType = getRevenueField(track, 'revenueType');\n+  if (revenueType) {\n+    payload.revenueType = revenueType;\n+  }\n+  var productId = getRevenueField(track, 'productId');","path":"lib/mapper.js","position":31,"original_position":31,"commit_id":"af9b0fe77ed987cec39b0f121ec7c756c44b7e41","original_commit_id":"af9b0fe77ed987cec39b0f121ec7c756c44b7e41","user":{"login":"djih","id":4776584,"avatar_url":"https://avatars.githubusercontent.com/u/4776584?v=3","gravatar_id":"","url":"https://api.github.com/users/djih","html_url":"https://github.com/djih","followers_url":"https://api.github.com/users/djih/followers","following_url":"https://api.github.com/users/djih/following{/other_user}","gists_url":"https://api.github.com/users/djih/gists{/gist_id}","starred_url":"https://api.github.com/users/djih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djih/subscriptions","organizations_url":"https://api.github.com/users/djih/orgs","repos_url":"https://api.github.com/users/djih/repos","events_url":"https://api.github.com/users/djih/events{/privacy}","received_events_url":"https://api.github.com/users/djih/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2016-07-26T21:59:54Z","updated_at":"2016-07-26T21:59:54Z","html_url":"https://github.com/segment-integrations/integration-amplitude/pull/19#discussion_r72346038","pull_request_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/comments/72346038"},"html":{"href":"https://github.com/segment-integrations/integration-amplitude/pull/19#discussion_r72346038"},"pull_request":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19","id":78405517,"html_url":"https://github.com/segment-integrations/integration-amplitude/pull/19","diff_url":"https://github.com/segment-integrations/integration-amplitude/pull/19.diff","patch_url":"https://github.com/segment-integrations/integration-amplitude/pull/19.patch","issue_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/19","number":19,"state":"open","locked":false,"title":"Parse additional revenue fields","user":{"login":"djih","id":4776584,"avatar_url":"https://avatars.githubusercontent.com/u/4776584?v=3","gravatar_id":"","url":"https://api.github.com/users/djih","html_url":"https://github.com/djih","followers_url":"https://api.github.com/users/djih/followers","following_url":"https://api.github.com/users/djih/following{/other_user}","gists_url":"https://api.github.com/users/djih/gists{/gist_id}","starred_url":"https://api.github.com/users/djih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djih/subscriptions","organizations_url":"https://api.github.com/users/djih/orgs","repos_url":"https://api.github.com/users/djih/repos","events_url":"https://api.github.com/users/djih/events{/privacy}","received_events_url":"https://api.github.com/users/djih/received_events","type":"User","site_admin":false},"body":"This mirrors the 3 recent updates to our other integrations (iOS, Android, JS), making some additional revenue fields available to users. Adding top level `price` and `quantity` (although both have to be defined in order to be set). Adding top level `productId` and `revenueType` fields as well. Added some additional tests.","created_at":"2016-07-21T23:45:10Z","updated_at":"2016-07-26T21:59:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2a67e22d85ba2e15286dafaf3aeb6a7888ac811","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19/commits","review_comments_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19/comments","review_comment_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/comments{/number}","comments_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/19/comments","statuses_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/statuses/af9b0fe77ed987cec39b0f121ec7c756c44b7e41","head":{"label":"amplitude:price_quantity","ref":"price_quantity","sha":"af9b0fe77ed987cec39b0f121ec7c756c44b7e41","user":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"repo":{"id":30949389,"name":"integration-amplitude","full_name":"amplitude/integration-amplitude","owner":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplitude/integration-amplitude","description":"Amplitude server-side integration","fork":true,"url":"https://api.github.com/repos/amplitude/integration-amplitude","forks_url":"https://api.github.com/repos/amplitude/integration-amplitude/forks","keys_url":"https://api.github.com/repos/amplitude/integration-amplitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplitude/integration-amplitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplitude/integration-amplitude/teams","hooks_url":"https://api.github.com/repos/amplitude/integration-amplitude/hooks","issue_events_url":"https://api.github.com/repos/amplitude/integration-amplitude/issues/events{/number}","events_url":"https://api.github.com/repos/amplitude/integration-amplitude/events","assignees_url":"https://api.github.com/repos/amplitude/integration-amplitude/assignees{/user}","branches_url":"https://api.github.com/repos/amplitude/integration-amplitude/branches{/branch}","tags_url":"https://api.github.com/repos/amplitude/integration-amplitude/tags","blobs_url":"https://api.github.com/repos/amplitude/integration-amplitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplitude/integration-amplitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplitude/integration-amplitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplitude/integration-amplitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplitude/integration-amplitude/statuses/{sha}","languages_url":"https://api.github.com/repos/amplitude/integration-amplitude/languages","stargazers_url":"https://api.github.com/repos/amplitude/integration-amplitude/stargazers","contributors_url":"https://api.github.com/repos/amplitude/integration-amplitude/contributors","subscribers_url":"https://api.github.com/repos/amplitude/integration-amplitude/subscribers","subscription_url":"https://api.github.com/repos/amplitude/integration-amplitude/subscription","commits_url":"https://api.github.com/repos/amplitude/integration-amplitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplitude/integration-amplitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplitude/integration-amplitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplitude/integration-amplitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplitude/integration-amplitude/contents/{+path}","compare_url":"https://api.github.com/repos/amplitude/integration-amplitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplitude/integration-amplitude/merges","archive_url":"https://api.github.com/repos/amplitude/integration-amplitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplitude/integration-amplitude/downloads","issues_url":"https://api.github.com/repos/amplitude/integration-amplitude/issues{/number}","pulls_url":"https://api.github.com/repos/amplitude/integration-amplitude/pulls{/number}","milestones_url":"https://api.github.com/repos/amplitude/integration-amplitude/milestones{/number}","notifications_url":"https://api.github.com/repos/amplitude/integration-amplitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplitude/integration-amplitude/labels{/name}","releases_url":"https://api.github.com/repos/amplitude/integration-amplitude/releases{/id}","deployments_url":"https://api.github.com/repos/amplitude/integration-amplitude/deployments","created_at":"2015-02-18T02:47:58Z","updated_at":"2016-02-08T21:12:39Z","pushed_at":"2016-07-21T23:41:11Z","git_url":"git://github.com/amplitude/integration-amplitude.git","ssh_url":"git@github.com:amplitude/integration-amplitude.git","clone_url":"https://github.com/amplitude/integration-amplitude.git","svn_url":"https://github.com/amplitude/integration-amplitude","homepage":"segment.com","size":41,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"segment-integrations:master","ref":"master","sha":"643b68db88fd0466aedcca15424181f81da1f87e","user":{"login":"segment-integrations","id":11207740,"avatar_url":"https://avatars.githubusercontent.com/u/11207740?v=3","gravatar_id":"","url":"https://api.github.com/users/segment-integrations","html_url":"https://github.com/segment-integrations","followers_url":"https://api.github.com/users/segment-integrations/followers","following_url":"https://api.github.com/users/segment-integrations/following{/other_user}","gists_url":"https://api.github.com/users/segment-integrations/gists{/gist_id}","starred_url":"https://api.github.com/users/segment-integrations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segment-integrations/subscriptions","organizations_url":"https://api.github.com/users/segment-integrations/orgs","repos_url":"https://api.github.com/users/segment-integrations/repos","events_url":"https://api.github.com/users/segment-integrations/events{/privacy}","received_events_url":"https://api.github.com/users/segment-integrations/received_events","type":"Organization","site_admin":false},"repo":{"id":26639832,"name":"integration-amplitude","full_name":"segment-integrations/integration-amplitude","owner":{"login":"segment-integrations","id":11207740,"avatar_url":"https://avatars.githubusercontent.com/u/11207740?v=3","gravatar_id":"","url":"https://api.github.com/users/segment-integrations","html_url":"https://github.com/segment-integrations","followers_url":"https://api.github.com/users/segment-integrations/followers","following_url":"https://api.github.com/users/segment-integrations/following{/other_user}","gists_url":"https://api.github.com/users/segment-integrations/gists{/gist_id}","starred_url":"https://api.github.com/users/segment-integrations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segment-integrations/subscriptions","organizations_url":"https://api.github.com/users/segment-integrations/orgs","repos_url":"https://api.github.com/users/segment-integrations/repos","events_url":"https://api.github.com/users/segment-integrations/events{/privacy}","received_events_url":"https://api.github.com/users/segment-integrations/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/segment-integrations/integration-amplitude","description":"Amplitude server-side integration","fork":false,"url":"https://api.github.com/repos/segment-integrations/integration-amplitude","forks_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/forks","keys_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/teams","hooks_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/hooks","issue_events_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/events{/number}","events_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/events","assignees_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/assignees{/user}","branches_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/branches{/branch}","tags_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/tags","blobs_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/statuses/{sha}","languages_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/languages","stargazers_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/stargazers","contributors_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/contributors","subscribers_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/subscribers","subscription_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/subscription","commits_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/contents/{+path}","compare_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/merges","archive_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/downloads","issues_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues{/number}","pulls_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls{/number}","milestones_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/milestones{/number}","notifications_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/labels{/name}","releases_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/releases{/id}","deployments_url":"https://api.github.com/repos/segment-integrations/integration-amplitude/deployments","created_at":"2014-11-14T13:31:36Z","updated_at":"2016-07-05T04:24:04Z","pushed_at":"2016-07-21T23:45:10Z","git_url":"git://github.com/segment-integrations/integration-amplitude.git","ssh_url":"git@github.com:segment-integrations/integration-amplitude.git","clone_url":"https://github.com/segment-integrations/integration-amplitude.git","svn_url":"https://github.com/segment-integrations/integration-amplitude","homepage":"segment.com","size":44,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19"},"html":{"href":"https://github.com/segment-integrations/integration-amplitude/pull/19"},"issue":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/19"},"comments":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/segment-integrations/integration-amplitude/statuses/af9b0fe77ed987cec39b0f121ec7c756c44b7e41"}}}}
{"actor":{"display_login":"djih"}}