承接 gandhist/ematerai 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

gandhist/ematerai

Composer 安装命令:

composer require gandhist/ematerai

包简介

Mekari eMaterai API Client for Laravel

README 文档

README

Unofficial Laravel library for eMaterai by Mekari

This is the unofficial library for eMaterai API by Mekari, for official documentation please visit Mekari

1. Installation

Install using Composer CLI : composer require gandhist/ematerai

2. How to use

2.1 General Setting

Add to your env variables :

    MATERAI_CLIENT_ID=<your client id>
    MATERAI_SECRET=<your client_secret>
    MATERAI_CODE=<your_auth_code>
    MATERAI_IS_PRODUCTION=false

Add use Gandhist\Ematerai\Config;, set configuration :

    Config::$isProduction =  false;
    Config::$clientId =  env('MATERAI_CLIENT_ID');
    Config::$clientSecret =  env('MATERAI_SECRET');
    Config::$authCode =  env('MATERAI_CODE');

2. 2 Stamp a document

For stamping a document, you have to convert your PDF to base64, you can use Base64 Guru to convert your document. Add use Gandhist\Ematerai\Stamping;

    $stamp = new Stamping;
    $base64 = "your_base_64_pdf_file";
    $filename = "your_file_name.pdf";
    $callback = "https://webhook.site/e91fe71f-6672-4ae6-86b2-9018ba4df5a3?validation_key=ABCDE";
    $annotation = [[
        "page"  =>  4, // page you want to stamp
        "position_x"  =>  150, // set x axis
        "position_y"  =>  450, // set y axis
        "element_width"  =>  80,
        "element_height"  =>  80,
        "canvas_width"  =>  836,
        "canvas_height"  =>  1181,
        "type_of"  =>  "meterai"
    ]];
    $stamping = $stamp->stamp($base64, $filename, $annotation, $callback);

2.3 Get detail document by document id

Add use Gandhist\Ematerai\Document;

$doc = new Document;
return $doc->detail("<document-id>");

2.4 Resend/Restamp document by document id

Add use Gandhist\Ematerai\Stamping;

$doc = new Stamping;
return $doc->restamp("<document-id>");

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-01