2017 © Pedro Peláez
 

library startkit

Pluggable components as service for your PHP application

image

codemojo/startkit

Pluggable components as service for your PHP application

  • Thursday, September 21, 2017
  • by shoaib-drewards
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,153 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 41 Versions
  • 0 % Grown

The README.md

About

Welcome to the CodeMojo SDK (Startup Development Toolkit). CodeMojo helps you to rapidly deploy application components as pluggable services for your PHP application allowing you to cut development time ramp up productivity., (*1)

Using the SDK is straight forward and simple. The SDK consist of four main services, (*2)

  1. Authentication Service
  2. Wallet Service
  3. Loyalty Service
  4. Meta Tagging Service

Download the PHP SDK here, (*3)

Download the Sample Application here, (*4)

See the Wiki for additional documentation, (*5)

See the Dashboard walkthrough for insights on how to use the dashboard, (*6)

Installation & Usage

Stock/Vanilla PHP, (*7)

Download the SDK and include the autoload.php to your source code, (*8)

Composer, (*9)

Simply add the following to your composer.json, (*10)

{
  "require": {
    "codemojo/startkit": "0.1.*"
  }
}

Example

Once you have enabled and configured the Loyalty module from your CodeMojo dashboard, you can use it as simple as shown below. More documentation on dashboard., (*11)

require_once '../sdk/autoload.php';

const CLIENT_ID     = 'sample@codemojo.io';
const CLIENT_SECRET = 'PLB6DHP7VcykRDdvloi2X9tEq3FvsIBhtdn7UdeQ';

// Create an instance of Authentication Service
$authService = new AuthenticationService(CLIENT_ID, CLIENT_SECRET, Endpoints::LOCAL, function($type, $message){
    switch($type){
        case Exceptions::AUTHENTICATION_EXCEPTION:
            echo 'Authentication Exception';
            break;
        case Exceptions::BALANCE_EXHAUSTED_EXCEPTION:
            echo 'Low balance';
            break;
        case Exceptions::FIELDS_MISSING_EXCEPTION:
            echo 'Fields missing';
            break;
        case Exceptions::QUOTA_EXCEPTION:
            echo 'Quota Exhausted Exception';
            break;
        case Exceptions::TOKEN_EXCEPTION:
            echo 'Invalid token Exception';
            break;
        default:
            echo 'Error ' . $message;
            break;
    }
});

// Create an instance of Loyalty Service - If you have more than one wallet service,
// you can optionally pass in the wallet instance as the second argument
$loyaltyService = new LoyaltyService($authService);

// Credit points to user - You can have different set of rules based on the platform
// For example, you can promote your android app by saying Get 5% more cashback when you transact through the Android app
$status = $loyaltyService->addLoyaltyPoints("user1@codemojo.io", 1500, "android", "", 7, "Cashback for Order no. 1231");

// Get the balance in the wallet
$balance = $loyaltyService->getBalance("user1@codemojo.io");

// Check how much maximum can be redeemed by the user for the given (current) transaction value
// Again, you can have different set of rules for redemption based on the platform
$maximumRedemption = $loyaltyService->maximumRedemption("user1@codemojo.io",8500);

// Redeem amount
// (user_id, redemption_amount, current_transaction_value, platform)
$loyaltyService->redeem("user1@codemojo.io", 500, 8500, "android");

For more details on the methods & parameters available for each service, take a look at the individual service pages., (*12)

The Versions

21/09 2017

dev-master

9999999-dev https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

21/09 2017

v0.1.940

0.1.940.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

19/09 2017

v0.1.939

0.1.939.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

25/05 2017

v0.1.938

0.1.938.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

09/03 2017

v0.1.937

0.1.937.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

09/03 2017

v0.1.936

0.1.936.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

16/02 2017

v0.1.935

0.1.935.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

20/01 2017

v0.1.934

0.1.934.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

15/01 2017

v0.1.933

0.1.933.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

15/01 2017

v0.1.932

0.1.932.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

06/01 2017

v0.1.931

0.1.931.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

08/12 2016

v0.1.93

0.1.93.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

23/11 2016

v0.1.92

0.1.92.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

16/11 2016

v0.1.91

0.1.91.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

02/11 2016

v0.1.90

0.1.90.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

25/07 2016

v0.1.89

0.1.89.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

05/07 2016

v0.1.87

0.1.87.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

05/07 2016

v0.1.88

0.1.88.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

30/06 2016

v0.1.86

0.1.86.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/06 2016

v0.1.85

0.1.85.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

21/06 2016

v0.1.84

0.1.84.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

21/06 2016

v0.1.83

0.1.83.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

21/06 2016

v0.1.82

0.1.82.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

18/06 2016

v0.1.8

0.1.8.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

18/06 2016

v0.1.81

0.1.81.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

06/04 2016

v0.1.71

0.1.71.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

30/03 2016

v0.1.7

0.1.7.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

01/03 2016

v0.1.6

0.1.6.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/02 2016

v0.1.54

0.1.54.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/02 2016

v0.1.53

0.1.53.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/02 2016

v0.1.52

0.1.52.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/02 2016

v0.1.51

0.1.51.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

28/02 2016

v0.1.5

0.1.5.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

22/02 2016

v0.1.4

0.1.4.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

20/02 2016

v0.1.3

0.1.3.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

19/02 2016

v0.1.2

0.1.2.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

17/02 2016

v0.1.1

0.1.1.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

15/02 2016

v0.1

0.1.0.0 https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

15/02 2016

v0.1.2-alpha

0.1.2.0-alpha https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

29/01 2016

v0.1.1-alpha

0.1.1.0-alpha https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo

29/01 2016

v0.1-alpha

0.1.0.0-alpha https://github.com/codemojo-dr/codemojo-php-sdk

Pluggable components as service for your PHP application

  Sources   Download

GNU

The Requires

  • php >=5.2.0

 

loyalty wallet drewards codemojo