andrefelipe18/abacatepay-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

andrefelipe18/abacatepay-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require andrefelipe18/abacatepay-php

包简介

AbacatePay PHP SDK

README 文档

README

AbacatePay is a PHP library for integrating with the AbacatePay payment gateway.

Installation

Install the library using Composer:

composer require andrefelipe18/abacatepay-php

Usage

Initialize the Library

First, you need to initialize the AbacatePay class with your API token:

require __DIR__ . '/../vendor/autoload.php';

use Andrefelipe18\AbacatePay\AbacatePay;

$abacatePay = new AbacatePay('your_api_token');

Create a Customer

You can create a new customer using the create method:

$customer = $abacatePay->customer()->create(
    new \Andrefelipe18\AbacatePay\Models\Customer(
        'customer@example.com',
        'Customer Name',
        '+1234567890',
        '123456789'
    )
);

List Customers

You can list all customers using the list method:

$customers = $abacatePay->customer()->list();

Create a Billing

To create a new billing, use the create method:

$billing = $abacatePay->billing()->create(
    'ONE_TIME',
    ['PIX'],
    [
        new \Andrefelipe18\AbacatePay\Models\Product(
            'product_1',
            'Product 1',
            'Product 1 description',
            1,
            1000
        ),
        new \Andrefelipe18\AbacatePay\Models\Product(
            'product_2',
            'Product 2',
            'Product 2 description',
            1,
            2000
        ),
    ],
    'https://example.com/return',
    'https://example.com/completion',
    $customer->data->metadata,
);

List Billings

You can list all billings using the list method:

$billings = $abacatePay->billing()->list();

License

Licensed under the MIT license.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-02-07