2017 © Pedro Peláez
 

library php-sdk

Payment Rails PHP Client Library

image

paymentrails/php-sdk

Payment Rails PHP Client Library

  • Monday, April 23, 2018
  • by koblas
  • Repository
  • 4 Watchers
  • 4 Stars
  • 54 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 5 Versions
  • 69 % Grown

The README.md

Trolley PHP SDK

Latest Stable Version PHP Version Require, (*1)

The Trolley PHP SDK provides integration access to the Trolley API., (*2)

Requirements

PHP version >= 5.4.0 is required., (*3)

The following PHP extensions are required:, (*4)

curl json mbstring openssl, (*5)

Installation & Usage

SDK

git clone https://github.com/PaymentRails/php-sdk.git

Composer

Install PHP Composer, (*6)

To install the bindings via Composer, add the following to composer.json:, (*7)

composer require trolley/core

Then run composer install, (*8)

Getting Started

Please follow the installation procedure and then run the following:, (*9)

<?php

// This line is for the Composer autoloader
require_once 'vendor/autoload.php';

// Or use this if installed via git clone
// require_once 'php-sdk/lib/autoload.php';

use Trolley;

Trolley\Configuration::publicKey(YOUR_ACCESS_KEY);
Trolley\Configuration::privateKey(YOUR_SECRET_KEY);

try {
    $recipients = Trolley\Recipient::all();

    foreach ($recipients as $rcpt) {
      print_r($rcpt->id . "\n");
    }
} catch (Exception $e) {
    echo 'Exception when calling Trolley\\Recipient::all ', $e->getMessage(), PHP_EOL;
}

Documentation for API Endpoints

All URIs are available at https://docs.trolley.com/, (*10)

Running SDK from Source

  1. Clone this repo.
  2. Install dependencies by running composer install from the project root.
  3. Access the SDK source code from your code by using Trolley namespace as per the path you put the SDK source code on.

Environment Variables

While running from source locally, you can use a .env file to supply a custom server URL., (*11)

The tests use the .env file anyway to load the API keys.
If you're running tests, make sure the .env file exists in the project root., (*12)

For your ease, a sample .env.example file is provided, which can be copied to create the .env file:, (*13)

$ cp .env.example .env

Once copied, edit the .env file to supply the values needed., (*14)

Running the tests from SDK

To run the tests in the terminal, you'll need to setup the .env file to supply API Keys, and then use the PHPUnit test suite from within the tests directory, like the following:, (*15)

$ cp .env.example .env
 // Edit the .env file to supply API Keys

$ cd tests
$ ../vendor/bin/phpunit integration/RecipientTest.php

If you want to provide a custom server URL, provide the server URL in the .env file , and set the sdk configuration to use the development server:, (*16)

Configuration::environment('development');

Refer to the inline documentation about this in the test setup file: /tests/Setup.php:38, (*17)

The Versions

23/04 2018

dev-master

9999999-dev https://github.com/PaymentRails/php-sdk

Payment Rails PHP Client Library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *
  • ext-openssl *

 

The Development Requires

paymentrails

23/04 2018

2.0.2

2.0.2.0 https://github.com/PaymentRails/php-sdk

Payment Rails PHP Client Library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *
  • ext-openssl *

 

The Development Requires

paymentrails

20/02 2018

dev-updated_docs

dev-updated_docs https://github.com/PaymentRails/php-sdk

Payment Rails PHP Client Library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *
  • ext-openssl *

 

The Development Requires

paymentrails

29/10 2017

2.0.1

2.0.1.0 https://github.com/PaymentRails/php-sdk

Payment Rails PHP Client Library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *
  • ext-openssl *

 

The Development Requires

paymentrails

27/10 2017

2.0.0

2.0.0.0 https://github.com/PaymentRails/php-sdk

Payment Rails PHP Client Library

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *
  • ext-openssl *

 

The Development Requires

api php sdk paymentrails paymentrailsapi