定制 alphaolomi/simplify-vfd 二次开发

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

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

alphaolomi/simplify-vfd

最新稳定版本:v0.1.0

Composer 安装命令:

composer require alphaolomi/simplify-vfd

包简介

Simplify VFD

README 文档

README

Latest Version on Packagist Tests Total Downloads codecov

Simplify VFD is a PHP library to interact with the Simplify VFD API. This library provides a simple and easy-to-use interface to integrate VFD services into your PHP applications.

Features

  • User Authentication: Authenticate users and obtain access tokens.
  • Invoice Management: Create, retrieve, and manage invoices.
  • Environment Configuration: Switch between live and stage environments.
  • HTTP Client Integration: Uses Guzzle HTTP client for making API requests.
  • Custom GUID Generation: Utility function for generating unique identifiers.

Installation

You can install the package via Composer:

composer require alphaolomi/simplify-vfd

Configuration

The SimplifyVfd class requires a configuration array with the following keys:

  • environment: The environment to use (live or stage).
  • username: Your Simplify VFD username.
  • password: Your Simplify VFD password.

Usage

Initializing the Service

use Alphaolomi\SimplifyVfd\SimplifyVfd;

$config = [
    'environment' => 'stage', // or 'live'
    'username' => 'your_username',
    'password' => 'your_password',
];
$service = new SimplifyVfd($config, $client);

User Login

$data = [
    'username' => 'your_username',
    'password' => 'your_password'
];

$response = $service->userLogin($data);
print_r($response);

Create Issued Invoice

$data = [
    'dateTime' => date('Y-m-d'),
    'customer' => [
        'identificationType' => 'ID',
        'identificationNumber' => '1234567890',
        'vatRegistrationNumber' => '123456789',
        'name' => 'Customer Name',
        'mobileNumber' => '255123456789',
        'email' => 'customer@example.com',
    ],
    'invoiceAmountType' => 'GROSS',
    'items' => [
        [
            'itemName' => 'Product 1',
            'quantity' => 1,
            'price' => 100.00
        ]
    ],
    'payments' => [
        [
            'paymentType' => 'CASH',
            'amount' => 100.00
        ]
    ],
    'partnerInvoiceId' => 'unique-invoice-id'
];

$response = $service->createIssuedInvoice($data);
print_r($response);

Get Invoice by Partner Invoice ID

$partnerInvoiceId = 'unique-invoice-id';

$response = $service->getInvoiceByPartnerInvoiceId($partnerInvoiceId);
print_r($response);

Testing

Using PestPHP for testing, Code coverage is generated by PHPUnit. Codecov is used to generate code coverage reports and badges.

composer test

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-11