paymentrails / php-sdk
Trolley PHP SDK
Installs: 455 576
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 11
Forks: 7
Open Issues: 6
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: 5.7.*
- ramsey/uuid: *
- dev-master
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.7
- 2.0.6
- 2.0.5.x-dev
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- dev-DEVREL-64-cover-missing-recipient-api
- dev-DEVREL-65-cover-missing-batch-api
- dev-DEVREL-66-cover-missing-offline-payments
- dev-DEVREL-67-cover-missing-balance-api
- dev-DEVREL-63-cover-invoice-payment-api
- dev-DEVREL-39-cover-invoice-API
- dev-DEVREL-41-return-error-array
- dev-DEVREL-68-remove-environments
- dev-DEVREL-40-cover-invoice-line-API
- dev-DEVREL-99-update-batch-summary
- dev-DEVREL-43-rename-to-trolley
- dev-dev
- dev-analytics-and-rebranding
- dev-introduce-changelog
- dev-updated_docs
This package is not auto-updated.
Last update: 2023-05-01 17:01:18 UTC
README
The Trolley PHP SDK provides integration access to the Trolley API.
Requirements
PHP version >= 5.4.0 is required.
The following PHP extensions are required:
curl json mbstring openssl
Installation & Usage
SDK
git clone https://github.com/PaymentRails/php-sdk.git
Composer
To install the bindings via Composer, add the following to composer.json
:
composer require paymentrails/php-sdk
Then run composer install
Getting Started
Please follow the installation procedure and then run the following:
<?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 PaymentRails; // Configure API key authorization: merchantKey PaymentRails\Configuration::environment('production'); PaymentRails\Configuration::publicKey(YOUR_PUBLIC_KEY); PaymentRails\Configuration::privateKey(YOUR_PRIVATE_KEY); try { $recipients = PaymentRails\Recipient::all(); foreach ($recipients as $rcpt) { print_r($rcpt->id . "\n"); } } catch (Exception $e) { echo 'Exception when calling PaymentRails\\Recipient::all ', $e->getMessage(), PHP_EOL; }
Documentation for API Endpoints
All URIs are available at https://docs.trolley.com/
Running SDK from Source
- Clone this repo.
- Install dependencies by running
composer install
from the project root. - Access the SDK source code from your code by using
PaymentRails
namespace as per the path you put the SDK source code on.
Running the tests from SDK
To run the tests in the terminal, use the PHPUnit test suite from within the tests
directory, like the following:
$ cd tests
$ ../vendor/bin/phpunit integration/RecipientTest.php
Footnotes
-
Payment Rails is now Trolley. We're in the process of updating our SDKs to support the new domain. In this transition phase, you might still see "PaymentRails" at some places. ↩