{"action":"created","comment":{"url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/comments/50141444","id":50141444,"diff_hunk":"@@ -1,13 +1,52 @@\n package com.finix.payments.processing.client;\n \n+import com.fasterxml.jackson.dataformat.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;\n+import com.finix.payments.processing.api.model.res.UserResources;\n+import org.springframework.core.ParameterizedTypeReference;\n+import org.springframework.hateoas.MediaTypes;\n+import org.springframework.hateoas.Resources;\n+import org.springframework.hateoas.client.Traverson;\n+import org.springframework.http.HttpHeaders;\n+import org.springframework.web.client.RestOperations;\n+import org.springframework.web.client.RestTemplate;\n+\n+import java.net.URI;\n+import java.net.URISyntaxException;\n+\n /**\n  *\n  */\n public class ProcessingClient {\n \n-  String baseUrl;\n+  private String relPath;\n+  private Traverson traverson;\n+\n+  public ProcessingClient(Configuration configuration) {\n+    try {\n+      traverson = new Traverson(new URI(configuration.getBaseUrl()), MediaTypes.HAL_JSON);\n+      RestOperations restOperations = new RestTemplate();\n+      traverson.setRestOperations(restOperations);\n+    }\n+    catch (URISyntaxException e) {\n+      //TODO re-throw the exception\n+    }\n+  }\n+\n+  public ProcessingClient(Configuration configuration, String relPath) {\n+    this(configuration);\n+    this.relPath = relPath;\n+  }\n+\n+  public UserResources followAndFetch(String basicUser, String basicPassword) {\n+    return followAndFetch(this.relPath, basicUser, basicPassword);\n+  }\n \n-  public ProcessingClient(String baseUrl) {\n-    this.baseUrl = baseUrl;\n+  public UserResources followAndFetch(String path, String basicUser, String basicPassword) {","path":"src/main/java/com/finix/payments/processing/client/ProcessingClient.java","position":47,"original_position":47,"commit_id":"8f7e87e693478e921904f477a5db10c192444595","original_commit_id":"8f7e87e693478e921904f477a5db10c192444595","user":{"login":"mjallday","id":252280,"avatar_url":"https://avatars.githubusercontent.com/u/252280?v=3","gravatar_id":"","url":"https://api.github.com/users/mjallday","html_url":"https://github.com/mjallday","followers_url":"https://api.github.com/users/mjallday/followers","following_url":"https://api.github.com/users/mjallday/following{/other_user}","gists_url":"https://api.github.com/users/mjallday/gists{/gist_id}","starred_url":"https://api.github.com/users/mjallday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjallday/subscriptions","organizations_url":"https://api.github.com/users/mjallday/orgs","repos_url":"https://api.github.com/users/mjallday/repos","events_url":"https://api.github.com/users/mjallday/events{/privacy}","received_events_url":"https://api.github.com/users/mjallday/received_events","type":"User","site_admin":false},"body":"user/pass should be part of the configuration. \r\n","created_at":"2016-01-19T17:07:58Z","updated_at":"2016-01-19T17:07:58Z","html_url":"https://github.com/finix-payments/processing-java-client/pull/7#discussion_r50141444","pull_request_url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/comments/50141444"},"html":{"href":"https://github.com/finix-payments/processing-java-client/pull/7#discussion_r50141444"},"pull_request":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7","id":56431693,"html_url":"https://github.com/finix-payments/processing-java-client/pull/7","diff_url":"https://github.com/finix-payments/processing-java-client/pull/7.diff","patch_url":"https://github.com/finix-payments/processing-java-client/pull/7.patch","issue_url":"https://api.github.com/repos/finix-payments/processing-java-client/issues/7","number":7,"state":"open","locked":false,"title":"New ProcessingClient interface","user":{"login":"phuonghuynh","id":705510,"avatar_url":"https://avatars.githubusercontent.com/u/705510?v=3","gravatar_id":"","url":"https://api.github.com/users/phuonghuynh","html_url":"https://github.com/phuonghuynh","followers_url":"https://api.github.com/users/phuonghuynh/followers","following_url":"https://api.github.com/users/phuonghuynh/following{/other_user}","gists_url":"https://api.github.com/users/phuonghuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/phuonghuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuonghuynh/subscriptions","organizations_url":"https://api.github.com/users/phuonghuynh/orgs","repos_url":"https://api.github.com/users/phuonghuynh/repos","events_url":"https://api.github.com/users/phuonghuynh/events{/privacy}","received_events_url":"https://api.github.com/users/phuonghuynh/received_events","type":"User","site_admin":false},"body":"Please help to review the code. Will continue if no reply.","created_at":"2016-01-19T07:46:36Z","updated_at":"2016-01-19T17:07:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"921ad39513c2303830110cd2126780c92012fb60","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7/commits","review_comments_url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7/comments","review_comment_url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/finix-payments/processing-java-client/issues/7/comments","statuses_url":"https://api.github.com/repos/finix-payments/processing-java-client/statuses/8f7e87e693478e921904f477a5db10c192444595","head":{"label":"phuonghuynh:master","ref":"master","sha":"8f7e87e693478e921904f477a5db10c192444595","user":{"login":"phuonghuynh","id":705510,"avatar_url":"https://avatars.githubusercontent.com/u/705510?v=3","gravatar_id":"","url":"https://api.github.com/users/phuonghuynh","html_url":"https://github.com/phuonghuynh","followers_url":"https://api.github.com/users/phuonghuynh/followers","following_url":"https://api.github.com/users/phuonghuynh/following{/other_user}","gists_url":"https://api.github.com/users/phuonghuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/phuonghuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuonghuynh/subscriptions","organizations_url":"https://api.github.com/users/phuonghuynh/orgs","repos_url":"https://api.github.com/users/phuonghuynh/repos","events_url":"https://api.github.com/users/phuonghuynh/events{/privacy}","received_events_url":"https://api.github.com/users/phuonghuynh/received_events","type":"User","site_admin":false},"repo":{"id":49802720,"name":"processing-java-client","full_name":"phuonghuynh/processing-java-client","owner":{"login":"phuonghuynh","id":705510,"avatar_url":"https://avatars.githubusercontent.com/u/705510?v=3","gravatar_id":"","url":"https://api.github.com/users/phuonghuynh","html_url":"https://github.com/phuonghuynh","followers_url":"https://api.github.com/users/phuonghuynh/followers","following_url":"https://api.github.com/users/phuonghuynh/following{/other_user}","gists_url":"https://api.github.com/users/phuonghuynh/gists{/gist_id}","starred_url":"https://api.github.com/users/phuonghuynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuonghuynh/subscriptions","organizations_url":"https://api.github.com/users/phuonghuynh/orgs","repos_url":"https://api.github.com/users/phuonghuynh/repos","events_url":"https://api.github.com/users/phuonghuynh/events{/privacy}","received_events_url":"https://api.github.com/users/phuonghuynh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phuonghuynh/processing-java-client","description":"","fork":true,"url":"https://api.github.com/repos/phuonghuynh/processing-java-client","forks_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/forks","keys_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/teams","hooks_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/hooks","issue_events_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/events","assignees_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/tags","blobs_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/languages","stargazers_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/stargazers","contributors_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/contributors","subscribers_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/subscribers","subscription_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/subscription","commits_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/merges","archive_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/downloads","issues_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/labels{/name}","releases_url":"https://api.github.com/repos/phuonghuynh/processing-java-client/releases{/id}","created_at":"2016-01-17T04:18:33Z","updated_at":"2016-01-17T04:18:35Z","pushed_at":"2016-01-19T02:59:43Z","git_url":"git://github.com/phuonghuynh/processing-java-client.git","ssh_url":"git@github.com:phuonghuynh/processing-java-client.git","clone_url":"https://github.com/phuonghuynh/processing-java-client.git","svn_url":"https://github.com/phuonghuynh/processing-java-client","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"finix-payments:master","ref":"master","sha":"f9f260283a9ec7c72e3e4a93887e8bb2d8838d7a","user":{"login":"finix-payments","id":16740039,"avatar_url":"https://avatars.githubusercontent.com/u/16740039?v=3","gravatar_id":"","url":"https://api.github.com/users/finix-payments","html_url":"https://github.com/finix-payments","followers_url":"https://api.github.com/users/finix-payments/followers","following_url":"https://api.github.com/users/finix-payments/following{/other_user}","gists_url":"https://api.github.com/users/finix-payments/gists{/gist_id}","starred_url":"https://api.github.com/users/finix-payments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finix-payments/subscriptions","organizations_url":"https://api.github.com/users/finix-payments/orgs","repos_url":"https://api.github.com/users/finix-payments/repos","events_url":"https://api.github.com/users/finix-payments/events{/privacy}","received_events_url":"https://api.github.com/users/finix-payments/received_events","type":"Organization","site_admin":false},"repo":{"id":49801948,"name":"processing-java-client","full_name":"finix-payments/processing-java-client","owner":{"login":"finix-payments","id":16740039,"avatar_url":"https://avatars.githubusercontent.com/u/16740039?v=3","gravatar_id":"","url":"https://api.github.com/users/finix-payments","html_url":"https://github.com/finix-payments","followers_url":"https://api.github.com/users/finix-payments/followers","following_url":"https://api.github.com/users/finix-payments/following{/other_user}","gists_url":"https://api.github.com/users/finix-payments/gists{/gist_id}","starred_url":"https://api.github.com/users/finix-payments/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finix-payments/subscriptions","organizations_url":"https://api.github.com/users/finix-payments/orgs","repos_url":"https://api.github.com/users/finix-payments/repos","events_url":"https://api.github.com/users/finix-payments/events{/privacy}","received_events_url":"https://api.github.com/users/finix-payments/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/finix-payments/processing-java-client","description":"","fork":false,"url":"https://api.github.com/repos/finix-payments/processing-java-client","forks_url":"https://api.github.com/repos/finix-payments/processing-java-client/forks","keys_url":"https://api.github.com/repos/finix-payments/processing-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/finix-payments/processing-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/finix-payments/processing-java-client/teams","hooks_url":"https://api.github.com/repos/finix-payments/processing-java-client/hooks","issue_events_url":"https://api.github.com/repos/finix-payments/processing-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/finix-payments/processing-java-client/events","assignees_url":"https://api.github.com/repos/finix-payments/processing-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/finix-payments/processing-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/finix-payments/processing-java-client/tags","blobs_url":"https://api.github.com/repos/finix-payments/processing-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/finix-payments/processing-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/finix-payments/processing-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/finix-payments/processing-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/finix-payments/processing-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/finix-payments/processing-java-client/languages","stargazers_url":"https://api.github.com/repos/finix-payments/processing-java-client/stargazers","contributors_url":"https://api.github.com/repos/finix-payments/processing-java-client/contributors","subscribers_url":"https://api.github.com/repos/finix-payments/processing-java-client/subscribers","subscription_url":"https://api.github.com/repos/finix-payments/processing-java-client/subscription","commits_url":"https://api.github.com/repos/finix-payments/processing-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/finix-payments/processing-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/finix-payments/processing-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/finix-payments/processing-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/finix-payments/processing-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/finix-payments/processing-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/finix-payments/processing-java-client/merges","archive_url":"https://api.github.com/repos/finix-payments/processing-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/finix-payments/processing-java-client/downloads","issues_url":"https://api.github.com/repos/finix-payments/processing-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/finix-payments/processing-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/finix-payments/processing-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/finix-payments/processing-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/finix-payments/processing-java-client/labels{/name}","releases_url":"https://api.github.com/repos/finix-payments/processing-java-client/releases{/id}","created_at":"2016-01-17T03:50:27Z","updated_at":"2016-01-17T04:06:23Z","pushed_at":"2016-01-19T07:46:36Z","git_url":"git://github.com/finix-payments/processing-java-client.git","ssh_url":"git@github.com:finix-payments/processing-java-client.git","clone_url":"https://github.com/finix-payments/processing-java-client.git","svn_url":"https://github.com/finix-payments/processing-java-client","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7"},"html":{"href":"https://github.com/finix-payments/processing-java-client/pull/7"},"issue":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/issues/7"},"comments":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/finix-payments/processing-java-client/statuses/8f7e87e693478e921904f477a5db10c192444595"}}}}