2017 © Pedro Peláez
 

library sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

image

dc/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  • Monday, September 19, 2016
  • by vegardlarsen
  • Repository
  • 2 Watchers
  • 0 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PSWinCom SMS gateway

This library implements PSWinCom's SMS gateway using XML over HTTP(s). For now, only the CPA and bulk SMS messages are supported., (*1)

Installation

composer require dc/sms_pswincom

or in composer.json, (*2)

"require": {
    "dc/sms_pswincom": "master"
}

Sending messages

require_once "vendor/autoload.php";

$configuration = new \DC\SMS\PSWinCom\Configuration();
$configuration->username = "username";
$configuration->password = "password";
$gateway = new \DC\SMS\PSWinCom\Gateway($configuration);

$message = new \DC\SMS\TextMessage("message text", "<msisdn>");

$receipt = $gateway->sendMessage($message);

if ($receipt->wasEnqueued()) {
    echo "Enqueued";
} else {
    echo "Failed";
}

Processing delivery reports

Set up your delivery end point so you can receive the XML data PSWinCom sends you. Here is an example:, (*3)

// assuming you have $gateway from above example
$report = $gateway->parseDeliveryReport(file_get_contents('php://input'));

// by default, use the successful response for the gateway
$return = $report->getSuccessfullyProcessedResponse();
if ($report->isSuccess()) {
  if (!$db->markMessageReceived($report->getMessageIdentifier())) {
    // we somehow couldn't save the information, so notify the gateway
    $return = $report->getErrorInProcessingReport();
  }
}

// tell the gateway that we processed (or didn't process) the message
http_response_code($return->getHTTPResponseCode());
foreach ($return->getHeaders() as $key => $value) {
    header(sprintf("%s: %s", $key, $value));
}
echo $return->getContent();

The Versions

19/09 2016

dev-master

9999999-dev http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

15/04 2015

0.1.7

0.1.7.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

05/01 2015

0.1.6

0.1.6.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

09/12 2014

0.1.5

0.1.5.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

09/12 2014

0.1.4

0.1.4.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

26/11 2014

0.1.3

0.1.3.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

26/11 2014

0.1.2

0.1.2.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

23/10 2014

0.1.1

0.1.1.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires

22/10 2014

0.1

0.1.0.0 http://github.com/digitalcreations/sms_pswincom

Implementation of PSWinCom's XML API over HTTP(S)

  Sources   Download

MIT

The Requires

 

The Development Requires