定制 paymentassist/paymentassist-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

paymentassist/paymentassist-php

最新稳定版本:2.1.0

Composer 安装命令:

composer require paymentassist/paymentassist-php

包简介

PHP SDK for the Payment Assist Partner API

README 文档

README

PHP SDK for the Payment Assist Partner API.

Note

paymentassist-php v2 is now the default version. For legacy integrations, please see the v1 branch.

Dependencies

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

Workflow

Payment Assist API Workflow

Installation

Install with Composer:

composer require paymentassist/paymentassist-php:dev-v2

Publish configuration files

Use composer to publish configuration files:

composer --working-dir=vendor/paymentassist/paymentassist-php/ run-script publish-config

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.

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.

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.

Refer to API documentation for details of valid endpoints and required params.

Contributing

We welcome contributions. There are several ways to help out:

  • 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

Support

For integrations support, please email itsupport@payment-assist.co.uk.

统计信息

  • 总下载量: 4k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固