2017 © Pedro Peláez
 

library paymentassist-php

PHP SDK for the Payment Assist Partner API

image

paymentassist/paymentassist-php

PHP SDK for the Payment Assist Partner API

  • Wednesday, December 20, 2017
  • by passist
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

paymentassist-php

PHP SDK for the Payment Assist Partner API., (*1)

[!NOTE] paymentassist-php v2 is now the default version. For legacy integrations, please see the v1 branch., (*2)

Dependencies

  • PHP >= 7.2
  • PHP JSON extension
  • PHP cURL extension

Workflow

Payment Assist API Workflow, (*3)

Installation

Install with Composer:, (*4)

composer require paymentassist/paymentassist-php:dev-v2, (*5)

Publish configuration files

Use composer to publish configuration files:, (*6)

composer --working-dir=vendor/paymentassist/paymentassist-php/ run-script publish-config, (*7)

Usage


use PaymentAssist\ApiClient; $config = [ 'debug' => true, 'timeout' => 120, 'log' => [ 'debug' => true, 'log_file_name' => 'apiclient.log', 'log_file_path' => 'PATH-TO-YOUR-LOGS-FOLDER', 'log_request_before_response' => true, 'log_app_name' => 'ApiClient', 'log_format' => null, // if null, a default format from GuzzleHttp\MessageFormatter class will be used ], 'verify_ssl_certificate' => true, 'default' => 'partner_api_v1', 'connections' => [ 'partner_api_v1' => [ 'base_uri' => 'https://api.v1.payment-assist.co.uk', 'manifest_path' => 'default', // use manifest files stored within the package 'api_key' => 'YOUR-KEY', 'secret' => 'YOUR-SECRET', 'additional_query_param' => [], ], ], ]; $client = ApiClient::instance($config)->setConnection(ApiClient::PARTNER_API_V1); $response = $client->GetAccountConfigurationDetails(); if ($response->isOK()) { $plans = collection( $response ->getContent() ->getData() ->getPlans() ->toArray() )->map(function ($plan) { return $plan['name']; })->toList(); } else { echo($response->getStatus() . ' ' . $response->getReason()); echo('There was an error fetching plans from the API: ' . $response->getContents()->getMessage()); }

In the above example $config variable contains a config structure which needs to be provided as an argument to ApiClient::instance() static method., (*8)

This structure can be stored in the config section of your application. After installing the package you can publish an example config file. Composer script will copy the file apiclient.php to the config folder in the root folder of your app if it exists, otherwise it will copy the file to the root folder of your app., (*9)

Config file contains the structure and the default config values which can be overridden by the values stored in the file .apiclient.env which will be copied to the root folder of your app., (*10)

Refer to [API documentation][2] for details of valid endpoints and required params., (*11)

Contributing

We welcome contributions. There are several ways to help out:, (*12)

  • Create an issue on GitHub, if you have found a bug.
  • Write patches for open bugs/feature issues, preferably with test cases included. Please fork our repo, make your changes in a new branch and then open a pull request ensuring the correct target branch.
  • Contribute to the [documentation][2]

Support

For integrations support, please email itsupport@payment-assist.co.uk., (*13)

The Versions

20/12 2017

dev-master

9999999-dev

PHP SDK for the Payment Assist Partner API

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-curl *

 

api paymentassist payment-assist.co.uk payment assist

19/12 2017

1.0

1.0.0.0

PHP SDK for the Payment Assist Partner API

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-curl *

 

api paymentassist payment-assist.co.uk payment assist