2017 © Pedro Peláez
 

library yourmembership-laravel-api

YourMembership.com PHP API for Laravel

image

coolcodemy/yourmembership-laravel-api

YourMembership.com PHP API for Laravel

  • Friday, January 20, 2017
  • by coolcodemy
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

YourMembership-Laravel-API

This package in a work in progress, it is based on the code YM-API.

This package implements a PHP wrapper to work with http://www.yourmembership.com/company/api-reference/, (*1)

Laravel Installation (5.2+)

Require this package with composer by adding the following to your composer file:, (*2)

"require": {
    "coolcodemy/yourmembership-laravel-api": "^0.0.1"
},

Then run composer update to download the package., (*3)

Or use, (*4)

composer require coolcodemy/yourmembership-laravel-api

After updating composer, add the service provider to the providers array in config/app.php, (*5)

CoolCodeMY\YourMembershipLaravelAPI\YourMembershipServiceProvider::class,

Publish the config for the package, (*6)

php artisan vendor:publish --provider="CoolCodeMY\YourMembershipLaravelAPI\YourMembershipServiceProvider"

Fill in your API_KEY, SECRET_API_KEY and SA_PASSCODE inside config/yourmembership-laravel-api.php., (*7)

Usage

<?php
...
use CoolCodeMY\YourMembershipLaravelAPI\YMLA;

class YourController extends Controller {

    public function index(YMLA $ymla)
    {
        // Array results
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => 'email@examle.com',
            'Password' => 'password',
        ])->toArray();

        // JSON/Object result
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => 'email@examle.com',
            'Password' => 'password',
        ])->toJson();

        // XML result
        $result = $ymla->call('Auth.Authenticate', [
            'Username' => 'email@examle.com',
            'Password' => 'password',
        ])->toXML();
    }
    ...
}

Notes on YourMembership session

You don't need to generate session for authentication as this package will do it for you. The SessionID is saved inside Laravel cache for 15 minutes., (*8)

Returning the RAW XML results from YourMembership

This will return the results as XML and set the return header to XML for the browser to properly print valid XML., (*9)

...
$result = $ymla->call('Auth.Authenticate', [
    'Username' => 'email@examle.com',
    'Password' => 'password',
])->toXML();

return response()->xml($result);
...

The Versions

20/01 2017

dev-master

9999999-dev

YourMembership.com PHP API for Laravel

  Sources   Download

MIT

The Requires

 

by Ahmad Fikrizaman Bin Abd Rahim

laravel api php yourmembership.com

20/01 2017

0.0.1

0.0.1.0

YourMembership.com PHP API for Laravel

  Sources   Download

MIT

The Requires

 

by Ahmad Fikrizaman Bin Abd Rahim

laravel api php yourmembership.com