{"action":"created","comment":{"url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/comments/122600900","pull_request_review_id":44730362,"id":122600900,"diff_hunk":"@@ -0,0 +1,75 @@\n+import Redux from 'redux'\n+import {connect} from 'react-redux'\n+import Checkout, {CheckoutStateProps, CheckoutDispatchProps} from './Checkout'\n+import {toPrevious} from '../actions/Card'\n+import {checkoutSetState} from '../actions/Checkout'\n+import {openSnackbar} from '../actions/Snackbar'\n+import {authSettings} from '../Constants'\n+import {logEvent} from '../React'\n+import {AppState, CheckoutPhase, CheckoutState, QuestState, UserState} from '../reducers/StateTypes'\n+\n+declare var window:any;\n+\n+\n+const mapStateToProps = (state: AppState, ownProps: any): CheckoutStateProps => {\n+  return {\n+    checkout: state.checkout,\n+    quest: state.quest,\n+    user: state.user,\n+  };\n+}\n+\n+const mapDispatchToProps = (dispatch: Redux.Dispatch<any>, ownProps: any): CheckoutDispatchProps => {\n+  return {\n+    onError: (err: string): void => {\n+      logEvent('checkout_err', err);\n+      dispatch(openSnackbar('Error encountered: ' + err));\n+    },\n+    onHome: (): void => {\n+      dispatch(toPrevious('QUEST_START', undefined, true));\n+    },\n+    onPhaseChange: (phase: CheckoutPhase): void => {\n+      dispatch(checkoutSetState({phase}));\n+    },\n+    onSubmit: (braintree: any, checkout: CheckoutState, user: UserState): void => {\n+      dispatch(checkoutSetState({phase: 'PROCESSING'}));\n+      braintree.requestPaymentMethod((err: string, payload: any) => {\n+        if (err) {\n+          logEvent('checkout_request_err', err);\n+          dispatch(openSnackbar('Error encountered: ' + err));\n+          return dispatch(checkoutSetState({phase: 'ENTRY'}));\n+        }\n+        $.post({\n+          url: authSettings.urlBase + '/braintree/checkout',\n+          data: JSON.stringify({\n+            nonce: payload.nonce,\n+            amount: checkout.amount,\n+            productcategory: checkout.productcategory,\n+            productid: checkout.productid,\n+            userid: user.id,\n+            useremail: user.email,\n+          }),\n+          dataType: 'json',\n+        })\n+        .done((response: string) => {\n+// TODO what do API errors look like? Show to user and report","path":"app/components/CheckoutContainer.tsx","position":55,"original_position":55,"commit_id":"81cc1811dbf3a50c1a8ddb122916dad408eacfd8","original_commit_id":"81cc1811dbf3a50c1a8ddb122916dad408eacfd8","user":{"login":"smartin015","id":607666,"avatar_url":"https://avatars1.githubusercontent.com/u/607666?v=3","gravatar_id":"","url":"https://api.github.com/users/smartin015","html_url":"https://github.com/smartin015","followers_url":"https://api.github.com/users/smartin015/followers","following_url":"https://api.github.com/users/smartin015/following{/other_user}","gists_url":"https://api.github.com/users/smartin015/gists{/gist_id}","starred_url":"https://api.github.com/users/smartin015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartin015/subscriptions","organizations_url":"https://api.github.com/users/smartin015/orgs","repos_url":"https://api.github.com/users/smartin015/repos","events_url":"https://api.github.com/users/smartin015/events{/privacy}","received_events_url":"https://api.github.com/users/smartin015/received_events","type":"User","site_admin":false},"body":"Indent comments pls","created_at":"2017-06-18T21:08:49Z","updated_at":"2017-06-18T21:13:04Z","html_url":"https://github.com/ExpeditionRPG/expedition-app/pull/361#discussion_r122600900","pull_request_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361","_links":{"self":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/comments/122600900"},"html":{"href":"https://github.com/ExpeditionRPG/expedition-app/pull/361#discussion_r122600900"},"pull_request":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361"}}},"pull_request":{"url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361","id":125689517,"html_url":"https://github.com/ExpeditionRPG/expedition-app/pull/361","diff_url":"https://github.com/ExpeditionRPG/expedition-app/pull/361.diff","patch_url":"https://github.com/ExpeditionRPG/expedition-app/pull/361.patch","issue_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/361","number":361,"state":"open","locked":false,"title":"Braintree payment / author tipping","user":{"login":"toddmedema","id":775657,"avatar_url":"https://avatars1.githubusercontent.com/u/775657?v=3","gravatar_id":"","url":"https://api.github.com/users/toddmedema","html_url":"https://github.com/toddmedema","followers_url":"https://api.github.com/users/toddmedema/followers","following_url":"https://api.github.com/users/toddmedema/following{/other_user}","gists_url":"https://api.github.com/users/toddmedema/gists{/gist_id}","starred_url":"https://api.github.com/users/toddmedema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddmedema/subscriptions","organizations_url":"https://api.github.com/users/toddmedema/orgs","repos_url":"https://api.github.com/users/toddmedema/repos","events_url":"https://api.github.com/users/toddmedema/events{/privacy}","received_events_url":"https://api.github.com/users/toddmedema/received_events","type":"User","site_admin":false},"body":"Closes https://github.com/ExpeditionRPG/expedition-app/issues/358\r\n\r\nSpec on what it'll take to set up author accounts to accept tips via a Braintree submerchant account: https://github.com/ExpeditionRPG/expedition-quest-creator/issues/298\r\n\r\nv2 ideas and notes here, but this PR was already getting pretty intense + this is the MVP of usefulness: https://github.com/ExpeditionRPG/expedition-app/issues/362\r\n<img width=\"352\" alt=\"screen shot 2017-06-15 at 12 18 16 pm\" src=\"https://user-images.githubusercontent.com/775657/27191116-cc5cf3b6-51c4-11e7-8c9b-87f7f419b65a.png\">\r\n<img width=\"353\" alt=\"screen shot 2017-06-15 at 12 18 23 pm\" src=\"https://user-images.githubusercontent.com/775657/27191117-cc64071e-51c4-11e7-9c50-55fe059607f1.png\">\r\n<img width=\"352\" alt=\"screen shot 2017-06-15 at 12 18 31 pm\" src=\"https://user-images.githubusercontent.com/775657/27191118-cc664b50-51c4-11e7-9390-6affd7966005.png\">\r\n<img width=\"352\" alt=\"screen shot 2017-06-15 at 12 18 40 pm\" src=\"https://user-images.githubusercontent.com/775657/27191132-d39adbde-51c4-11e7-9c30-5c16e6f4a035.png\">\r\n","created_at":"2017-06-14T20:48:10Z","updated_at":"2017-06-18T21:13:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a67250ef03257f99ed91697f30023011da65658","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361/commits","review_comments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361/comments","review_comment_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/361/comments","statuses_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/statuses/81cc1811dbf3a50c1a8ddb122916dad408eacfd8","head":{"label":"ExpeditionRPG:braintree","ref":"braintree","sha":"81cc1811dbf3a50c1a8ddb122916dad408eacfd8","user":{"login":"ExpeditionRPG","id":26279990,"avatar_url":"https://avatars3.githubusercontent.com/u/26279990?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpeditionRPG","html_url":"https://github.com/ExpeditionRPG","followers_url":"https://api.github.com/users/ExpeditionRPG/followers","following_url":"https://api.github.com/users/ExpeditionRPG/following{/other_user}","gists_url":"https://api.github.com/users/ExpeditionRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpeditionRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpeditionRPG/subscriptions","organizations_url":"https://api.github.com/users/ExpeditionRPG/orgs","repos_url":"https://api.github.com/users/ExpeditionRPG/repos","events_url":"https://api.github.com/users/ExpeditionRPG/events{/privacy}","received_events_url":"https://api.github.com/users/ExpeditionRPG/received_events","type":"Organization","site_admin":false},"repo":{"id":55982594,"name":"expedition-app","full_name":"ExpeditionRPG/expedition-app","owner":{"login":"ExpeditionRPG","id":26279990,"avatar_url":"https://avatars3.githubusercontent.com/u/26279990?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpeditionRPG","html_url":"https://github.com/ExpeditionRPG","followers_url":"https://api.github.com/users/ExpeditionRPG/followers","following_url":"https://api.github.com/users/ExpeditionRPG/following{/other_user}","gists_url":"https://api.github.com/users/ExpeditionRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpeditionRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpeditionRPG/subscriptions","organizations_url":"https://api.github.com/users/ExpeditionRPG/orgs","repos_url":"https://api.github.com/users/ExpeditionRPG/repos","events_url":"https://api.github.com/users/ExpeditionRPG/events{/privacy}","received_events_url":"https://api.github.com/users/ExpeditionRPG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ExpeditionRPG/expedition-app","description":"The App for Expedition: The Roleplaying Card Game","fork":false,"url":"https://api.github.com/repos/ExpeditionRPG/expedition-app","forks_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/forks","keys_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/teams","hooks_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/hooks","issue_events_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/events{/number}","events_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/events","assignees_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/assignees{/user}","branches_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/branches{/branch}","tags_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/tags","blobs_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/statuses/{sha}","languages_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/languages","stargazers_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/stargazers","contributors_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/contributors","subscribers_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/subscribers","subscription_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/subscription","commits_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/contents/{+path}","compare_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/merges","archive_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/downloads","issues_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues{/number}","pulls_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls{/number}","milestones_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/milestones{/number}","notifications_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/labels{/name}","releases_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/releases{/id}","deployments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/deployments","created_at":"2016-04-11T15:08:06Z","updated_at":"2017-03-08T15:45:23Z","pushed_at":"2017-06-18T20:38:25Z","git_url":"git://github.com/ExpeditionRPG/expedition-app.git","ssh_url":"git@github.com:ExpeditionRPG/expedition-app.git","clone_url":"https://github.com/ExpeditionRPG/expedition-app.git","svn_url":"https://github.com/ExpeditionRPG/expedition-app","homepage":"http://app.expeditiongame.com","size":14563,"stargazers_count":5,"watchers_count":5,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":13,"forks":4,"open_issues":13,"watchers":5,"default_branch":"master"}},"base":{"label":"ExpeditionRPG:master","ref":"master","sha":"4387bf40f1645d67803e1ea03d1d35ea64688a11","user":{"login":"ExpeditionRPG","id":26279990,"avatar_url":"https://avatars3.githubusercontent.com/u/26279990?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpeditionRPG","html_url":"https://github.com/ExpeditionRPG","followers_url":"https://api.github.com/users/ExpeditionRPG/followers","following_url":"https://api.github.com/users/ExpeditionRPG/following{/other_user}","gists_url":"https://api.github.com/users/ExpeditionRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpeditionRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpeditionRPG/subscriptions","organizations_url":"https://api.github.com/users/ExpeditionRPG/orgs","repos_url":"https://api.github.com/users/ExpeditionRPG/repos","events_url":"https://api.github.com/users/ExpeditionRPG/events{/privacy}","received_events_url":"https://api.github.com/users/ExpeditionRPG/received_events","type":"Organization","site_admin":false},"repo":{"id":55982594,"name":"expedition-app","full_name":"ExpeditionRPG/expedition-app","owner":{"login":"ExpeditionRPG","id":26279990,"avatar_url":"https://avatars3.githubusercontent.com/u/26279990?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpeditionRPG","html_url":"https://github.com/ExpeditionRPG","followers_url":"https://api.github.com/users/ExpeditionRPG/followers","following_url":"https://api.github.com/users/ExpeditionRPG/following{/other_user}","gists_url":"https://api.github.com/users/ExpeditionRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpeditionRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpeditionRPG/subscriptions","organizations_url":"https://api.github.com/users/ExpeditionRPG/orgs","repos_url":"https://api.github.com/users/ExpeditionRPG/repos","events_url":"https://api.github.com/users/ExpeditionRPG/events{/privacy}","received_events_url":"https://api.github.com/users/ExpeditionRPG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ExpeditionRPG/expedition-app","description":"The App for Expedition: The Roleplaying Card Game","fork":false,"url":"https://api.github.com/repos/ExpeditionRPG/expedition-app","forks_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/forks","keys_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/teams","hooks_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/hooks","issue_events_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/events{/number}","events_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/events","assignees_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/assignees{/user}","branches_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/branches{/branch}","tags_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/tags","blobs_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/statuses/{sha}","languages_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/languages","stargazers_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/stargazers","contributors_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/contributors","subscribers_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/subscribers","subscription_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/subscription","commits_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/contents/{+path}","compare_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/merges","archive_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/downloads","issues_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues{/number}","pulls_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls{/number}","milestones_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/milestones{/number}","notifications_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/labels{/name}","releases_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/releases{/id}","deployments_url":"https://api.github.com/repos/ExpeditionRPG/expedition-app/deployments","created_at":"2016-04-11T15:08:06Z","updated_at":"2017-03-08T15:45:23Z","pushed_at":"2017-06-18T20:38:25Z","git_url":"git://github.com/ExpeditionRPG/expedition-app.git","ssh_url":"git@github.com:ExpeditionRPG/expedition-app.git","clone_url":"https://github.com/ExpeditionRPG/expedition-app.git","svn_url":"https://github.com/ExpeditionRPG/expedition-app","homepage":"http://app.expeditiongame.com","size":14563,"stargazers_count":5,"watchers_count":5,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":13,"forks":4,"open_issues":13,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361"},"html":{"href":"https://github.com/ExpeditionRPG/expedition-app/pull/361"},"issue":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/361"},"comments":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/issues/361/comments"},"review_comments":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361/comments"},"review_comment":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/pulls/361/commits"},"statuses":{"href":"https://api.github.com/repos/ExpeditionRPG/expedition-app/statuses/81cc1811dbf3a50c1a8ddb122916dad408eacfd8"}}}}
{"actor":{"display_login":"smartin015"}}