amarneche/slickpay-laravel

Slick-Pay Laravel 包的改进版本。

1.0.0 2023-09-27 19:46 UTC

This package is auto-updated.

Last update: 2024-10-01 00:07:34 UTC


README

Slick-Pay Logo

描述

Laravel 包,用于实现 Slick-Pay API。

先决条件

  • PHP 7.4 或更高版本;
  • curl 扩展必须启用;
  • Laravel 8.0 或更高。

安装

只需运行以下命令行

composer require amarneche/slickpay-laravel

配置

首先,您必须使用命令行发布包配置文件

php artisan vendor:publish --tag=SlickPay-config

现在,您可以在项目的 config 文件夹中找到一个名为 extended_slickpay.php 的文件。

<?php

return [
    'sandbox'    => true,
    'public_key' => env('SLICKPAY_KEY' ,''),
];

沙盒

将指示您是否要使用沙盒环境或实时环境(默认:true)。

公钥

您可以从您的 slick-pay.com 控制台中检索您的 PUBLIC_KEY

如何使用?

重要:请查看在线文档以获取有关 Slick-Pay API 请求参数和响应的更多详细信息。

可用类

用户

  • SlickPay\User\Account:实现了 Slick-Pay 用户账户 API。
    • Account::store(array $data): array:在存储中存储一个新的账户。
    • Account::show(string $uuid): array:获取指定账户的数据。
    • Account::index(int $offset, int $page): array:获取用户账户列表。
    • Account::update(string $uuid, array $data): array:在存储中更新指定的账户。
    • Account::destroy(string $uuid): array:从存储中删除指定的账户。
  • SlickPay\User\Contact:实现了 Slick-Pay 用户联系 API。
    • Contact::store(array $data): array:在存储中存储一个新的联系。
    • Contact::show(string $uuid): array:获取指定联系的数据。
    • Contact::index(int $offset, int $page): array:获取用户联系列表。
    • Contact::update(string $uuid, array $data): array:在存储中更新指定的联系。
    • Contact::destroy(string $uuid): array:从存储中删除指定的联系。
  • SlickPay\User\Transfer:实现了 Slick-Pay 用户转账 API。
    • Transfer::commission(float $amount): array:计算转账佣金。
    • Transfer::store(array $data): array:在存储中存储一个新的转账。
    • Transfer::show(int $id): array:获取指定转账的数据。
    • Transfer::index(int $offset, int $page): array:获取用户转账列表。
    • Transfer::update(int $id, array $data): array:在存储中更新指定的转账。
    • Transfer::destroy(int $id): array:从存储中删除指定的转账。
  • SlickPay\User\Aggregation:实现了 Slick-Pay 用户聚合 API。
    • Aggregation::commission(float $amount): array:计算聚合佣金。
    • Aggregation::store(array $data): array:在存储中存储一个新的聚合。
    • Aggregation::show(int $id): array:获取指定聚合的数据。
    • Aggregation::index(int $offset, int $page): array:获取用户聚合列表。
    • Aggregation::update(int $id, array $data): array:在存储中更新指定的聚合。
    • Aggregation::destroy(int $id): array:从存储中删除指定的聚合。
  • SlickPay\User\Invoice:实现了 Slick-Pay 用户发票 API。
    • Invoice::commission(float $amount): array:计算发票佣金。
    • Invoice::store(array $data): array:在存储中存储一个新的发票。
    • Invoice::show(int $id): array : 获取指定的发票数据。
    • Invoice::index(int $offset, int $page): array : 获取用户发票列表。
    • Invoice::update(int $id, array $data): array : 更新存储中的指定发票。
    • Invoice::destroy(int $id): array : 从存储中移除指定的发票。

商家

  • SlickPay\Merchant\Invoice : 实现Slick-Pay商家发票API。
    • Invoice::store(array $data): array:在存储中存储一个新的发票。
    • Invoice::show(int $id): array : 获取指定的发票数据。
    • Invoice::index(int $offset, int $page): array : 获取商家发票列表。
    • Invoice::update(int $id, array $data): array : 更新存储中的指定发票。
    • Invoice::destroy(int $id): array : 从存储中移除指定的发票。

重要:所有上述类方法返回包含以下索引的数组:data(包含API响应),status(来自Slick-Pay API服务器的HTTP响应代码)和errors(包含错误信息的数组)。

更多帮助