2017 © Pedro Peláez
 

library ymapi

image

saiba/ymapi

  • Thursday, June 11, 2015
  • by SAIBA0011
  • Repository
  • 1 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

Yourmembership PHP Api

Install Requirements

  • Laravel
  • Composer
  • PHP 5.4 or above

Install via Composer:, (*1)

"require": {
    "saiba/ymapi": "1.0.*"
},

Run Composer Update, (*2)

composer update

Add YmapiServiceProvider to config/app.php:, (*3)

'providers' => array(
    'Saiba\Ymapi\YmapiServiceProvider'
);

Publish the config files:, (*4)

php artisan config:publish saiba/ymapi

edit the config files under app/config/packages/saiba/ymapi/config/config.php Note the username and password, this is used as the default authentication username and password for various methods that require authentication but not an authenticated user, (*5)

Usage

To get a list of all your event ids:, (*6)

<?php

use Saiba\Ymapi\Events\Event;

Route::get('/', function()
{
    $event = new Event();
    $events = $event->getIds();

    dd($events);
});

To search for a member: ( https://api.yourmembership.com/reference/2_00/People_All_Search.htm ), (*7)

<?php

use Saiba\Ymapi\People\Person;

Route::get('/', function()
{
    $params = [
        'SearchText' => 'Gerhard'
    ];

    $person = new Person();
    $result = $person->search($params);

    dd($result);
});

To Register a new member: ( https://api.yourmembership.com/reference/2_00/Sa_Members_Profile_Create.htm ), (*8)

<?php

use Saiba\Ymapi\People\Person;

Route::get('/', function()
{
    $params = [
        'EmailAddr' => 'john@example.com',
        'FirstName' => 'John',
        'LastName' => 'Doe',
        'Membership' => 'SAIBA Member & Business Accountant in Practice',
        'MembershipExpiry' => '2060-10-05 00:00:00',
        'MemberTypeCode' => '2014SAIBAMEM',
        'Username' => 'Johnd',
        'Password' => 'ThisismyPassword'
    ];

    $person = (new Person())->create($params);

    dd($person);

});

Please note when creating a new member you must follow the API Precisely all capitalization should be as per the API Documentation referenced above, (*9)

More features coming soon, this package is still under heavy development, (*10)

The Versions

11/06 2015
11/06 2015
17/11 2014
17/11 2014
17/11 2014
17/11 2014