Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Africa's talking integration #2903

Closed
wants to merge 1 commit into from
Closed

Conversation

willdoran
Copy link
Contributor

This pull request makes the following changes:

  • Adding Africa's Talking Support

Test checklist:

  • [ ]

  • I certify that I ran my checklist

Fixes ushahidi/platform# .

Ping @ushahidi/platform

@willdoran willdoran requested a review from rjmackay May 3, 2018 16:48
Copy link
Contributor

@rjmackay rjmackay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay more data sources! I've added a few suggestions.

I think the only changes that are a must are:

  • Fixing the secret used to verify messages coming back from AT
  • Adding some unit tests


public function getOptions()
{
return array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, add links to where to find API keys/secrets in the AT interface

{
// Check we have the required config
if (!isset($this->config['api_key']) || !isset($this->config['username'])) {
app('log')->warning('Could not send message with Africa\'s Talking, incomplete config');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use \Log::warning now. We finally have facades enabled for lumen!

]);
// Successfully executed the request
if ($response->getStatusCode() === 200) {
return array(MessageStatus::SENT, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does AT return a message ID or anything that we could save? (thats the 2nd parameter here)


public function verifySecret($secret)
{
if (isset($this->config['secret']) and $secret === $this->config['secret']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have secret in your getOptions above

public function registerRoutes(\Laravel\Lumen\Routing\Router $router)
{
$router->post('sms/africastalking', 'Ushahidi\App\DataSource\AfricasTalking\AfricasTalkingController@handleRequest');
$router->post('africastalking', 'Ushahidi\App\DataSource\AfricasTalking\AfricasTalkingController@handleRequest');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are AT callbacks always POST? Or should we allow GET too?

Since this is a new provider I'd suggest only adding 1 url, probably sms/africastalking.

@rjmackay rjmackay changed the base branch from lumen to develop May 9, 2018 02:59
@rjmackay
Copy link
Contributor

rjmackay commented May 9, 2018

@willdoran not sure if you saw my comments. Needs some revision

@rowasc rowasc added this to the Cleanup old PRs milestone Sep 19, 2018
@rowasc rowasc added the consider for upcoming cycle Shortlist of items to consider as on deck for next cycle or two. PM uses this sparingly. label Sep 4, 2019
@rowasc rowasc self-assigned this Sep 20, 2019
@rowasc
Copy link
Contributor

rowasc commented Dec 9, 2019

Keeping in our notion list for reference so we can bring it up to the current code soon, closing since we don't have a plan to go live with it YET https://www.notion.so/ushahidiorg/2019-12-09-Release-replica-setup-0d35a8a7154c4de5bc69bed183c74898?p=99331d4902914a24b965c97e9d1d9528&showMoveTo=true

@rowasc rowasc closed this Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consider for upcoming cycle Shortlist of items to consider as on deck for next cycle or two. PM uses this sparingly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants