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

WIP: twilio/sdk 8.x #21

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 11 additions & 6 deletions bootstrap/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function run()

$this->settings = include ('extension/twilio/settings/settings.ini.php');

require 'extension/twilio/vendor/twilio-php-master/Services/Twilio.php';
require 'extension/twilio/vendor/autoload.php';

if ($this->settings['ahenviroment'] == true) {
$this->ahinstance = erLhcoreClassInstance::getInstance();
Expand Down Expand Up @@ -449,18 +449,20 @@ public function sendManualMessage($params)

}

$client = new Services_Twilio($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']);
$client = new Twilio\Rest\Client($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']);

$paramsMMS = array(
'To' => $paramsSend['recipient'],
'From' => $paramsSend['originator'],
'Body' => $paramsSend['text']
);

// Attach MMS if required
$this->addMMSAttatchements($paramsMMS);

$client->account->messages->create($paramsMMS);
$client->messages->create(
$paramsSend['recipient'],
$paramsMMS
);

if ($params['create_chat'] == true) {

Expand Down Expand Up @@ -624,7 +626,7 @@ public function sendSMSUser($params)
}
}

$client = new Services_Twilio($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']);
$client = new Twilio\Rest\Client($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']);

$paramsMMS = array(
'To' => $paramsSend['recipient'],
Expand All @@ -635,7 +637,10 @@ public function sendSMSUser($params)
// Attach MMS if required
$this->addMMSAttatchements($paramsMMS);

$client->account->messages->create($paramsMMS);
$client->messages->create(
$paramsSend['recipient'],
$paramsMMS
);

if (! isset($chatVariables['twilio_sms_chat_send'])) {
$chatVariables['twilio_sms_chat_send'] = 0;
Expand Down
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "livehelperchat/twilio",
"version": "1.0",
"description": "Twilio for Live Helper Chat",
"type": "project",
"homepage": "https://livehelperchat.com/",
"license": "Apache-2.0",
"authors": [
{
"name": "Live helper Chat",
"homepage": "https://livehelperchat.com/"
}
],
"support": {
"email": "[email protected]"
},
"require": {
"php": ">=7.1.0",
"twilio/sdk": "^8.0"
},
"config": {
"vendor-dir": "vendor"
}
}
74 changes: 74 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit3789d80809ac28b31821c4097d1efe9c::getLoader();
Loading