Skip to content

geodrop/geodrop-sdk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geodrop-sdk-php

Geodrop is a provider of services and applications for the mobile market. You can use the Geodrop API to send and receive SMS from web or from your application and to build new Premium Service with your digital content. This PHP SDK allows you to easily use Geodrop SMS services. Except as otherwise noted, it is licensed under the Apache Licence, Version 2.0.

Usage

Download the folder geodrop. Each php file that uses the SDK must include the path of the geodrop folder:

set_include_path('geodrop_sdk_path/');

The examples are a good place to start. To create a new session you must include:

require_once 'SessionFactory.php';
require_once 'GeodropSession.php';

Then you can create a session:

$session = SessionFactory::buildSession_ResourceOwnerPasswordCredentials(
                      $application_id,$application_secret,$username,$password);

To send an SMS:

require_once 'SMSOut/SMSSend.php';

$requestSend = new SMSSend($recipient,$message,$sender);
$session->runMethod($requestSend);
echo "Response: ".$requestSend->getResponse()->toString()."\n";

To challenge a customer to confirm the telephone number in content provider initiated transaction and to charge the customer:

require_once 'dropPay/PortChallenge.php';
require_once 'dropPay/PortChargeOnDemandPurchases.php';

$requestChallenge = new PortChallenge($port,$recipient,$textChallenge,$custom);
if($session->runMethod($requestChallenge))
{
    echo "Insert PIN:\n";
    $pin = ""; /*retrieve the pin*/
    $order = $requestChallenge->getResponse()->get_order();
    $requestChargeOnDemand = new PortChargeOnDemandPurchases(
                                            $port,$recipient,$text,$order,$pin);
    $session->runMethod($requestChargeOnDemand);
    echo "Response: ".$requestChargeOnDemand->getResponse()->toString()."\n";
}

Documentation

The documentation is available in the doc folder and here.

Versioning

The semantic versioning is used. The format of the version number is MAJOR.MINOR.PATCH, where:

  • MAJOR is incremented when incompatible API changes are done;
  • MINOR is incremented when functionality in a backwards-compatible manner are added;
  • PATCH is incremented when backwards-compatible bug fixes are done.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Bug report

If you find a bug open an issue and report the problem.