定制 feimx/csd-converter 二次开发

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

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

feimx/csd-converter

Composer 安装命令:

composer require feimx/csd-converter

包简介

This package allow you to convert csd to required pem files

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

The feimx/csd_converter package provide a simple way for create .pem files for your CSD's.

Installation

You can install the package via composer:

composer require feimx/csd_converter

Usage

Firt need create a new instance of CsdConverter:

$converter = new FeiMx\Csd\CsdConverter();
echo $converter->serial_number();

Thats all, now you can access the cer info and save the news files to given path

echo $converter->serial_number;
echo $converter->tax_id;
echo $converter->valid_from; // instance of Carbon
echo $converter->valid_to; // instance of Carbon
echo $converter->getStatus();

valid_from and valid_to are instances of Carbon, so you can modify and format the dates:

echo $converter->valid_from->format('d/m/Y h:i a');
echo $converter->valid_to->format('d/m/Y h:i a');

getStatus() returns a expired, valid or invalid status:

if($converter->getStatus() === CsdConverter::VALID){}
if($converter->getStatus() === CsdConverter::INVALID){}
if($converter->getStatus() === CsdConverter::EXPIRED){}

You can verify if the files are a valid CSD:

var_dump($converter->isValidCsd()); // true or false

Now you can save the created files to a given path and assigne a optional filename:

$path = __DIR__.'/temp/';
$filename = 'VALIDCSD';
$converter->save($path, $filename);
//this create 4 files:
//__DIR__.'/temp/VALIDCSD.cer'
//__DIR__.'/temp/VALIDCSD.cer.pem'
//__DIR__.'/temp/VALIDCSD.key'
//__DIR__.'/temp/VALIDCSD.key.pem'

And last, but not less important, you can encryp the converted key into des3:

$file = __DIR__.'/temp/VALIDCSD.key.pem';
$password = 'secret';
$converter->encryptKey($file, $password);
//__DIR__.'/temp/VALIDCSD.enc.key'

Note: This is very useful with third party provider such as Finkok for stamp the CFDI

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email yorch@feimexico.com.mx instead of using the issue tracker.

Credits

Support us

FEI is a Digital Invoicing startup based in Yucatán, México. You'll find an overview of all our open source projects on our website.

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固