定制 supplycart/e-invoice 二次开发

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

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

supplycart/e-invoice

最新稳定版本:1.0.2

Composer 安装命令:

composer require supplycart/e-invoice

包简介

MyInvois Wrapper For PHP

README 文档

README

To install, run:

$ composer require supplycart/e-invoice

Usage with Laravel (tested on Laravel 11)

Login as Taxpayer System

use Supplycart\EInvoice\EInvoiceClient;
use Illuminate\Support\Facades\Cache;

$isProd = false;
$clientId = '5b75ce93-a6d1-4e02-943f-a24ffa1b46ec';
$clientSecret = 'e4d2fcc8-90a8-40cd-99be-08f3401fbb93';

$client = new EInvoiceClient(
    clientId: $clientId,
    clientSecret: $clientSecret,
    isProd: isProd
);

$client->login();

$accessToken = $client->getAccessToken();

//Alternative to store in cache and get it later
Cache::remember('some-key', $accessToken, 3600) // expires in 3600s (1hour)

// To reuse the cached accessToken
$client->setAccessToken(Cache::get('some-key'));

Login as Intermediary System

// same as login, just need to set $onBehalfOf which is the entity's TIN
$client->setOnBehalfOf($onBehalfOf); 

Validate Taxpayer's TIN

$tin = 'C1234567890';
$idType = 'BRN';
$idValue = '1234567890';

$response = $client->validateTaxPayerTin(
    tin: $tin,
    idType: $idType,
    idValue: $idValue
);

Get Document Details

$documentUuid = '5a282618-8ad0-4ad6-bc1d-7f2a326562cf';

$response = $client->getDocumentDetail($documentUuid);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-22