定制 propaysystems/payment-platform-api-interface 二次开发

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

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

propaysystems/payment-platform-api-interface

最新稳定版本:1.0.7

Composer 安装命令:

composer require propaysystems/payment-platform-api-interface

包简介

This is my package payment-platform-api-interface

README 文档

README

Tests

This package provides an interface for integrating with the payment API, facilitating seamless interactions and transactions. It simplifies the process of connecting to the payment API by abstracting the underlying HTTP requests and responses into a more user-friendly set of PHP methods. Users can easily install this package via Composer and start integrating their applications with the payment API, leveraging its functionalities to manage contacts, initiate payments, and query transaction statuses, among other features.

Installation

You can install the package via composer:

composer require propaysystems/payment-platform-api-interface

PHP Usage

$client = PaymentPlatformAPI::getInstance() //Singleton
         ->sandbox() //Use sandbox environment
         ->url('https://example.com') //Set host only if you have a custom host
         ->setVersion('v1')
         ->setCredentials('username', 'password');
         or
        ->setToken('132465789132465789');

//Get all contacts
$response = $client->contacts($filters = [], $includes = ['bankAccounts', 'products'], $sort = ['-contact_number'], $version = 'v1', $per_page = 10, $page = 1)->get();

Sorting is ascending by defailt  and can be reversed by adding a hyphen (-) to the start of the property name

Example:
$sort = ['name', '-created_at'];

Laravel Usage

Create config file

return [
    'url' => env('PAYMENT_PLATFORM_API_URL', ''),
    'version' => env('PAYMENT_PLATFORM_API_VERSION', 'v1'),
    'username' => env('PAYMENT_PLATFORM_API_USERNAME', 'secret'),
    'password' => env('PAYMENT_PLATFORM_API_PASSWORD', 'password'),
];

Register in the boot method of the app service provider

$this->app->bind(PaymentPlatformAPI::class, function() {
    return PaymentPlatformAPI::getInstance()
        ->url(config('custom.payment-platform-api.url'))
        ->setVersion(config('custom.payment-platform-api.version'))
        ->setCredentials(
            config('custom.payment-platform-api.username'), 
            config('custom.payment-platform-api.password')
        );
});

Use the singleton class in your application

$client = app(PaymentPlatformAPI::class);

Testing

composer test

Testing Coverage Report

XDEBUG_MODE=coverage ./vendor/bin/pest --coverage --coverage-xml=logs/coverage

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-19