{"action":"created","comment":{"url":"https://api.github.com/repos/ushahidi/platform/pulls/comments/185944124","pull_request_review_id":117439631,"id":185944124,"diff_hunk":"@@ -0,0 +1,154 @@\n+<?php\n+\n+namespace Ushahidi\\App\\DataSource\\AfricasTalking;\n+\n+/**\n+ * AfricasTalking Data Providers\n+ *\n+ * @author     Ushahidi Team <team@ushahidi.com>\n+ * @package    DataSource\\AfricasTalking\n+ * @copyright  2018 Ushahidi\n+ * @license    http://www.gnu.org/copyleft/gpl.html GNU General Public License Version 3 (GPLv3)\n+ */\n+\n+use Ushahidi\\App\\DataSource\\CallbackDataSource;\n+use Ushahidi\\App\\DataSource\\OutgoingAPIDataSource;\n+use Ushahidi\\App\\DataSource\\Message\\Type as MessageType;\n+use Ushahidi\\App\\DataSource\\Message\\Status as MessageStatus;\n+use Ushahidi\\Core\\Entity\\Contact;\n+use Log;\n+\n+class AfricasTalking implements CallbackDataSource, OutgoingAPIDataSource\n+{\n+\n+\tprotected $config;\n+\n+\t/**\n+\t * Constructor function for DataSource\n+\t */\n+\tpublic function __construct(array $config, \\GuzzleHttp\\Client $client = null)\n+\t{\n+\t\t$this->config = $config;\n+\t\t$this->client = $client;\n+\t}\n+\n+\tpublic function getName()\n+    {\n+\t\treturn 'AfricasTalking';\n+\t}\n+\n+\tpublic function getId()\n+\t{\n+\t\treturn strtolower($this->getName());\n+\t}\n+\n+\tpublic function getServices()\n+\t{\n+\t\treturn [MessageType::SMS];\n+\t}\n+\n+\tpublic function getOptions()\n+\t{\n+\t\treturn array(\n+\t\t\t'from' => array(\n+\t\t\t\t'label' => 'From',\n+\t\t\t\t'input' => 'text',\n+\t\t\t\t'description' => 'The from number',\n+\t\t\t\t'rules' => array('required')\n+\t\t\t),\n+\t\t\t'api_key' => array(\n+\t\t\t\t'label' => 'API Key',\n+\t\t\t\t'input' => 'text',\n+\t\t\t\t'description' => 'The API key',\n+\t\t\t\t'rules' => array('required')\n+\t\t\t),\n+\t\t\t'api_secret' => array(\n+\t\t\t\t'label' => 'API secret',\n+\t\t\t\t'input' => 'text',\n+\t\t\t\t'description' => 'The API secret',\n+\t\t\t\t'rules' => array('required')\n+\t\t\t),\n+\t\t\t'username' => array(\n+\t\t\t\t'label' => 'Africa\\'s Talking username',\n+\t\t\t\t'input' => 'text',\n+\t\t\t\t'description' => 'Africa\\'s Talking username',\n+\t\t\t\t'rules' => array('required')\n+\t\t\t)\n+\t\t);\n+\t}\n+\n+\t/**\n+\t * Contact type user for this provider\n+\t */\n+\tpublic $contact_type = Contact::PHONE;\n+\n+\t// Africa's Talking api url\n+\tprotected $apiUrl = 'https://api.africastalking.com/version1/messaging';\n+\n+\t/**\n+\t * @return mixed\n+\t */\n+\tpublic function send($to, $message, $title = \"\")\n+\t{\n+\t\t// Check we have the required config\n+\t\tif (!isset($this->config['api_key']) || !isset($this->config['username'])) {\n+\t\t\tapp('log')->warning('Could not send message with Africa\\'s Talking, incomplete config');","path":"src/App/DataSource/AfricasTalking/AfricasTalking.php","position":95,"original_position":95,"commit_id":"70cb5d15afabdb9564a60db8e9640ee6a75327bd","original_commit_id":"70cb5d15afabdb9564a60db8e9640ee6a75327bd","user":{"login":"rjmackay","id":7965,"avatar_url":"https://avatars2.githubusercontent.com/u/7965?v=4","gravatar_id":"","url":"https://api.github.com/users/rjmackay","html_url":"https://github.com/rjmackay","followers_url":"https://api.github.com/users/rjmackay/followers","following_url":"https://api.github.com/users/rjmackay/following{/other_user}","gists_url":"https://api.github.com/users/rjmackay/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmackay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmackay/subscriptions","organizations_url":"https://api.github.com/users/rjmackay/orgs","repos_url":"https://api.github.com/users/rjmackay/repos","events_url":"https://api.github.com/users/rjmackay/events{/privacy}","received_events_url":"https://api.github.com/users/rjmackay/received_events","type":"User","site_admin":false},"body":"You can just use `\\Log::warning` now. We finally have facades enabled for lumen!","created_at":"2018-05-03T21:39:34Z","updated_at":"2018-05-03T21:45:54Z","html_url":"https://github.com/ushahidi/platform/pull/2903#discussion_r185944124","pull_request_url":"https://api.github.com/repos/ushahidi/platform/pulls/2903","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/comments/185944124"},"html":{"href":"https://github.com/ushahidi/platform/pull/2903#discussion_r185944124"},"pull_request":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/2903"}}},"pull_request":{"url":"https://api.github.com/repos/ushahidi/platform/pulls/2903","id":185776321,"html_url":"https://github.com/ushahidi/platform/pull/2903","diff_url":"https://github.com/ushahidi/platform/pull/2903.diff","patch_url":"https://github.com/ushahidi/platform/pull/2903.patch","issue_url":"https://api.github.com/repos/ushahidi/platform/issues/2903","number":2903,"state":"open","locked":false,"title":"Africa's talking integration","user":{"login":"willdoran","id":2694405,"avatar_url":"https://avatars3.githubusercontent.com/u/2694405?v=4","gravatar_id":"","url":"https://api.github.com/users/willdoran","html_url":"https://github.com/willdoran","followers_url":"https://api.github.com/users/willdoran/followers","following_url":"https://api.github.com/users/willdoran/following{/other_user}","gists_url":"https://api.github.com/users/willdoran/gists{/gist_id}","starred_url":"https://api.github.com/users/willdoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdoran/subscriptions","organizations_url":"https://api.github.com/users/willdoran/orgs","repos_url":"https://api.github.com/users/willdoran/repos","events_url":"https://api.github.com/users/willdoran/events{/privacy}","received_events_url":"https://api.github.com/users/willdoran/received_events","type":"User","site_admin":false},"body":"This pull request makes the following changes:\r\n- Adding Africa's Talking Support\r\n\r\nTest checklist:\r\n- [ ]\r\n\r\n- [ ] I certify that I ran my checklist\r\n\r\nFixes ushahidi/platform# .\r\n\r\nPing @ushahidi/platform\r\n","created_at":"2018-05-03T16:48:12Z","updated_at":"2018-05-03T21:45:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ushahidi/platform/pulls/2903/commits","review_comments_url":"https://api.github.com/repos/ushahidi/platform/pulls/2903/comments","review_comment_url":"https://api.github.com/repos/ushahidi/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ushahidi/platform/issues/2903/comments","statuses_url":"https://api.github.com/repos/ushahidi/platform/statuses/70cb5d15afabdb9564a60db8e9640ee6a75327bd","head":{"label":"ushahidi:what-if-africas-talking","ref":"what-if-africas-talking","sha":"70cb5d15afabdb9564a60db8e9640ee6a75327bd","user":{"login":"ushahidi","id":16959,"avatar_url":"https://avatars3.githubusercontent.com/u/16959?v=4","gravatar_id":"","url":"https://api.github.com/users/ushahidi","html_url":"https://github.com/ushahidi","followers_url":"https://api.github.com/users/ushahidi/followers","following_url":"https://api.github.com/users/ushahidi/following{/other_user}","gists_url":"https://api.github.com/users/ushahidi/gists{/gist_id}","starred_url":"https://api.github.com/users/ushahidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ushahidi/subscriptions","organizations_url":"https://api.github.com/users/ushahidi/orgs","repos_url":"https://api.github.com/users/ushahidi/repos","events_url":"https://api.github.com/users/ushahidi/events{/privacy}","received_events_url":"https://api.github.com/users/ushahidi/received_events","type":"Organization","site_admin":false},"repo":{"id":6126775,"name":"platform","full_name":"ushahidi/platform","owner":{"login":"ushahidi","id":16959,"avatar_url":"https://avatars3.githubusercontent.com/u/16959?v=4","gravatar_id":"","url":"https://api.github.com/users/ushahidi","html_url":"https://github.com/ushahidi","followers_url":"https://api.github.com/users/ushahidi/followers","following_url":"https://api.github.com/users/ushahidi/following{/other_user}","gists_url":"https://api.github.com/users/ushahidi/gists{/gist_id}","starred_url":"https://api.github.com/users/ushahidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ushahidi/subscriptions","organizations_url":"https://api.github.com/users/ushahidi/orgs","repos_url":"https://api.github.com/users/ushahidi/repos","events_url":"https://api.github.com/users/ushahidi/events{/privacy}","received_events_url":"https://api.github.com/users/ushahidi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ushahidi/platform","description":"Ushahidi Platform v3 API","fork":false,"url":"https://api.github.com/repos/ushahidi/platform","forks_url":"https://api.github.com/repos/ushahidi/platform/forks","keys_url":"https://api.github.com/repos/ushahidi/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ushahidi/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ushahidi/platform/teams","hooks_url":"https://api.github.com/repos/ushahidi/platform/hooks","issue_events_url":"https://api.github.com/repos/ushahidi/platform/issues/events{/number}","events_url":"https://api.github.com/repos/ushahidi/platform/events","assignees_url":"https://api.github.com/repos/ushahidi/platform/assignees{/user}","branches_url":"https://api.github.com/repos/ushahidi/platform/branches{/branch}","tags_url":"https://api.github.com/repos/ushahidi/platform/tags","blobs_url":"https://api.github.com/repos/ushahidi/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ushahidi/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ushahidi/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/ushahidi/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ushahidi/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/ushahidi/platform/languages","stargazers_url":"https://api.github.com/repos/ushahidi/platform/stargazers","contributors_url":"https://api.github.com/repos/ushahidi/platform/contributors","subscribers_url":"https://api.github.com/repos/ushahidi/platform/subscribers","subscription_url":"https://api.github.com/repos/ushahidi/platform/subscription","commits_url":"https://api.github.com/repos/ushahidi/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/ushahidi/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/ushahidi/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/ushahidi/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/ushahidi/platform/contents/{+path}","compare_url":"https://api.github.com/repos/ushahidi/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ushahidi/platform/merges","archive_url":"https://api.github.com/repos/ushahidi/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ushahidi/platform/downloads","issues_url":"https://api.github.com/repos/ushahidi/platform/issues{/number}","pulls_url":"https://api.github.com/repos/ushahidi/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/ushahidi/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/ushahidi/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ushahidi/platform/labels{/name}","releases_url":"https://api.github.com/repos/ushahidi/platform/releases{/id}","deployments_url":"https://api.github.com/repos/ushahidi/platform/deployments","created_at":"2012-10-08T15:40:14Z","updated_at":"2018-05-02T23:10:22Z","pushed_at":"2018-05-03T16:50:48Z","git_url":"git://github.com/ushahidi/platform.git","ssh_url":"git@github.com:ushahidi/platform.git","clone_url":"https://github.com/ushahidi/platform.git","svn_url":"https://github.com/ushahidi/platform","homepage":"http://ushahidi.com","size":30099,"stargazers_count":455,"watchers_count":455,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":259,"mirror_url":null,"archived":false,"open_issues_count":622,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":259,"open_issues":622,"watchers":455,"default_branch":"develop"}},"base":{"label":"ushahidi:lumen","ref":"lumen","sha":"5b8c447ea1b74c249bb9d159aa9f1d58b64ce2fb","user":{"login":"ushahidi","id":16959,"avatar_url":"https://avatars3.githubusercontent.com/u/16959?v=4","gravatar_id":"","url":"https://api.github.com/users/ushahidi","html_url":"https://github.com/ushahidi","followers_url":"https://api.github.com/users/ushahidi/followers","following_url":"https://api.github.com/users/ushahidi/following{/other_user}","gists_url":"https://api.github.com/users/ushahidi/gists{/gist_id}","starred_url":"https://api.github.com/users/ushahidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ushahidi/subscriptions","organizations_url":"https://api.github.com/users/ushahidi/orgs","repos_url":"https://api.github.com/users/ushahidi/repos","events_url":"https://api.github.com/users/ushahidi/events{/privacy}","received_events_url":"https://api.github.com/users/ushahidi/received_events","type":"Organization","site_admin":false},"repo":{"id":6126775,"name":"platform","full_name":"ushahidi/platform","owner":{"login":"ushahidi","id":16959,"avatar_url":"https://avatars3.githubusercontent.com/u/16959?v=4","gravatar_id":"","url":"https://api.github.com/users/ushahidi","html_url":"https://github.com/ushahidi","followers_url":"https://api.github.com/users/ushahidi/followers","following_url":"https://api.github.com/users/ushahidi/following{/other_user}","gists_url":"https://api.github.com/users/ushahidi/gists{/gist_id}","starred_url":"https://api.github.com/users/ushahidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ushahidi/subscriptions","organizations_url":"https://api.github.com/users/ushahidi/orgs","repos_url":"https://api.github.com/users/ushahidi/repos","events_url":"https://api.github.com/users/ushahidi/events{/privacy}","received_events_url":"https://api.github.com/users/ushahidi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ushahidi/platform","description":"Ushahidi Platform v3 API","fork":false,"url":"https://api.github.com/repos/ushahidi/platform","forks_url":"https://api.github.com/repos/ushahidi/platform/forks","keys_url":"https://api.github.com/repos/ushahidi/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ushahidi/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ushahidi/platform/teams","hooks_url":"https://api.github.com/repos/ushahidi/platform/hooks","issue_events_url":"https://api.github.com/repos/ushahidi/platform/issues/events{/number}","events_url":"https://api.github.com/repos/ushahidi/platform/events","assignees_url":"https://api.github.com/repos/ushahidi/platform/assignees{/user}","branches_url":"https://api.github.com/repos/ushahidi/platform/branches{/branch}","tags_url":"https://api.github.com/repos/ushahidi/platform/tags","blobs_url":"https://api.github.com/repos/ushahidi/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ushahidi/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ushahidi/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/ushahidi/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ushahidi/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/ushahidi/platform/languages","stargazers_url":"https://api.github.com/repos/ushahidi/platform/stargazers","contributors_url":"https://api.github.com/repos/ushahidi/platform/contributors","subscribers_url":"https://api.github.com/repos/ushahidi/platform/subscribers","subscription_url":"https://api.github.com/repos/ushahidi/platform/subscription","commits_url":"https://api.github.com/repos/ushahidi/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/ushahidi/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/ushahidi/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/ushahidi/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/ushahidi/platform/contents/{+path}","compare_url":"https://api.github.com/repos/ushahidi/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ushahidi/platform/merges","archive_url":"https://api.github.com/repos/ushahidi/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ushahidi/platform/downloads","issues_url":"https://api.github.com/repos/ushahidi/platform/issues{/number}","pulls_url":"https://api.github.com/repos/ushahidi/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/ushahidi/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/ushahidi/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ushahidi/platform/labels{/name}","releases_url":"https://api.github.com/repos/ushahidi/platform/releases{/id}","deployments_url":"https://api.github.com/repos/ushahidi/platform/deployments","created_at":"2012-10-08T15:40:14Z","updated_at":"2018-05-02T23:10:22Z","pushed_at":"2018-05-03T16:50:48Z","git_url":"git://github.com/ushahidi/platform.git","ssh_url":"git@github.com:ushahidi/platform.git","clone_url":"https://github.com/ushahidi/platform.git","svn_url":"https://github.com/ushahidi/platform","homepage":"http://ushahidi.com","size":30099,"stargazers_count":455,"watchers_count":455,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":259,"mirror_url":null,"archived":false,"open_issues_count":622,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":259,"open_issues":622,"watchers":455,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/2903"},"html":{"href":"https://github.com/ushahidi/platform/pull/2903"},"issue":{"href":"https://api.github.com/repos/ushahidi/platform/issues/2903"},"comments":{"href":"https://api.github.com/repos/ushahidi/platform/issues/2903/comments"},"review_comments":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/2903/comments"},"review_comment":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ushahidi/platform/pulls/2903/commits"},"statuses":{"href":"https://api.github.com/repos/ushahidi/platform/statuses/70cb5d15afabdb9564a60db8e9640ee6a75327bd"}},"author_association":"OWNER"}}
{"actor":{"display_login":"rjmackay"}}