logocomune/c4w-myapps-sdk

This package is abandoned and no longer maintained. No replacement package was suggested.

Unofficial My Apps SDK

1.0.0 2017-05-04 18:29 UTC

This package is not auto-updated.

Last update: 2020-09-19 06:21:41 UTC


README

Unofficial PHP SDK for My Apps.

Official information are available into My Apps Tutorial

Install

The recommended way to install My Apps SDK is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of My Apps:

php composer.phar require logocomune/c4w-myapps-sdk

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update My Apps SDK using composer:

composer.phar update

Basic Usage

<?php
use MyAppsSdk\MyAppsSdk;
use MyAppsSdk\Exceptions\MyAppsSdkException;

require (__DIR__.'/vendor/autoload.php');
$myAppsSdk = new MyAppsSdk();

try {
    $context = $myAppsSdk->getContext();
    $customer =  $context->getCustomer();
    echo $customer->isLogged();
    //True
    echo $customer->getFirstName();
    //Customer name
    
    echo $context->getCompany()->getName();
    //company name
    
} catch (MyAppsSdkException $e){
    //...
    echo $e->getMessage();
}