2017 © Pedro Peláez
 

library sms-gateway

SMS Gateway to interface with Eurobate

image

jbbx2016/sms-gateway

SMS Gateway to interface with Eurobate

  • Thursday, June 7, 2018
  • by JBBx2016
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3,396 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 24 Versions
  • 23 % Grown

The README.md

SMS-Gateway

Library to send SMS using Eurobate gateway, (*1)

Installation using Composer

composer require jbbx2016/sms-gateway, (*2)

Basic usage

<?php

use JBBx2016\SMSGateway\Common\CountryCodes;
use JBBx2016\SMSGateway\Common\Exceptions\Exception;
use JBBx2016\SMSGateway\Common\PhoneNumber;
use JBBx2016\SMSGateway\Gateways\Eurobate\EurobateSendMessageResponse;
use JBBx2016\SMSGateway\Gateways\Eurobate\EurobateGateway;
use JBBx2016\SMSGateway\Payloads\SMSPayload;
use JBBx2016\SMSGateway\Senders\TextSender;
use JBBx2016\SMSGateway\SMSGatewayApi;

$SMSGatewayApi = new SMSGatewayApi();

$SMSGatewayApi->AddGateway(new EurobateGateway('username', 'password'));

try {

    /** @var EurobateSendMessageResponse $Response */
    $Response = $SMSGatewayApi->SendMessage(
        new TextSender('Avsender'),
        new SMSPayload(
            new PhoneNumber(CountryCodes::Norway, '98765432'),
            "This is the message body"
        )
    );

    $EurobateId = $Response->Id;

} catch (Exception $Exception) {

    $this->_Logger->Error('Failed to process SMS - Exception: ' . get_class($Exception) . "(" . $Exception->getMessage() . ")");

}

Send SMS from number

<?php

use JBBx2016\SMSGateway\Common\CountryCodes;
use JBBx2016\SMSGateway\Common\PhoneNumber;
use JBBx2016\SMSGateway\Payloads\SMSPayload;
use JBBx2016\SMSGateway\Senders\NumberSender;

$SMSGatewayApi->SendMessage(
    new NumberSender('203098765432'),
    new SMSPayload(
        new PhoneNumber(CountryCodes::Norway, '98765432'),
        "This is the message body"
    )
);

Eurobate: Specify delivery report endpoint

<?php

use JBBx2016\SMSGateway\Gateways\Eurobate\EurobateGateway;
use JBBx2016\SMSGateway\SMSGatewayApi;


$EurobateGateway = new EurobateGateway('username', 'password');
$EurobateGateway->SetDeliveryReportStatusEndpoint('http:// myhost.com/dlr.php?msgid=MSGID&status=STATUS&operator=OPERATOR&smscode=OPCODE&cbgcode=CBGCODE&stop=STOP');

$SMSGatewayApi = new SMSGatewayApi();
$SMSGatewayApi->AddGateway($EurobateGateway);

Exceptions

  • JBBx2016\SMSGateway\Common\Exceptions\Exception: Base exception
    • JBBx2016\SMSGateway\Common\Exceptions\GatewayEndpointConnectionFailedException: Connection to gateway endpoint failed
    • JBBx2016\SMSGateway\Common\Exceptions\GatewayAuthorizationException: Gateway authorization failed
    • JBBx2016\SMSGateway\Common\Exceptions\NoGatewayFoundException: Called if no appropriate gateway is found
    • JBBx2016\SMSGateway\Gateways\Eurobate\EurobateException: Exception for Eurobate gateway
    • JBBx2016\SMSGateway\Gateways\Eurobate\Exceptions\IPNotAuthorizedEurobateException: Eurobate specific error

The Versions

07/06 2018

dev-master

9999999-dev

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Beyer Bruvik
by Johannes Bruvik

07/06 2018

1.5.5

1.5.5.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

17/04 2018

1.5.4

1.5.4.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

17/04 2018

1.5.3

1.5.3.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

17/04 2018

1.5.2

1.5.2.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

17/04 2018

1.5.1

1.5.1.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

17/04 2018

1.5.0

1.5.0.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

05/04 2018

1.4.1

1.4.1.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

05/04 2018

1.4.0

1.4.0.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

21/03 2018

1.3.5

1.3.5.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

20/03 2018

1.3.4

1.3.4.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

20/03 2018

1.3.3

1.3.3.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

08/03 2018

1.3.2

1.3.2.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

08/03 2018

1.3.0

1.3.0.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

31/01 2018

1.2.3

1.2.3.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

02/11 2017

1.2.2

1.2.2.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

30/10 2017

1.2.1

1.2.1.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

22/10 2017

1.2.0

1.2.0.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

 

by Johannes Bruvik

06/03 2017

1.1.3

1.1.3.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik

28/02 2017

1.1.2

1.1.2.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik

23/02 2017

1.1.1

1.1.1.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik

23/02 2017

1.1.0

1.1.0.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik

22/02 2017

1.0.6

1.0.6.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik

21/02 2017

1.0.4

1.0.4.0

SMS Gateway to interface with Eurobate

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3

 

by Johannes Beyer Bruvik