danielpleal/prjapi

SaaS预算控制web服务的集成API库

1.0.0 2021-04-21 10:58 UTC

This package is auto-updated.

Last update: 2024-09-21 19:30:11 UTC


README

Maintainer Source Code PHP from Packagist Latest Version Software License Build Quality Score Total Downloads

PrjApi库是一组用于将SaaS平台集成到web服务的类。

PrjApi库是一个用于集成SaaS平台web服务的类小集。

您可以点击此处了解更多信息 这里

亮点

  • 简单安装
  • API方法抽象
  • 使用登录和密码轻松认证
  • Composer就绪,符合PSR-2规范

安装

通过Composer提供Uploader

"danielpleal/prjapi": "^1.0"

或者运行

composer require danielpleal/prjapi

文档

有关使用详情,请参阅组件目录中的示例文件夹。其中包含每个类的使用示例。它的工作方式如下

有关使用详情,请参阅组件目录中的示例文件夹。其中包含每个类的使用示例。它的工作方式如下

用户端点

<?php

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

use DanielPLeal\PrjApi\Me;

$me = new Me(
    "suaapi.url.com",
    "seu@email.com.br",
    "suasenha"
);

//me
$user = $me->me();

//update
$user->update([
    "first_name" => "Daniel",
    "last_name" => "Leal",
    "genre" => "male",
    "datebirth" => "1980-01-02",
    "document" => "888888888"
]);

//photo
$user->photo($_FILES["photo"]);

//test and result
if ($user->error()) {
    $user->error(); //object
} else {
    $user->response(); //object
}

发票端点

<?php

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

use DanielPLeal\PrjApi\Invoices;

$invoices = new Invoices(
    "suaapi.url.com",
    "seu@email.com.br",
    "suasenha"
);

//index
$index = $invoices->index(null);

//index filter
$index = $invoices->index([
    "wallet_id" => 23,
    "type" => "fixed_income",
    "status" => "paid",
    "page" => 2
]);

//create
$invoices->create([
    "wallet_id" => 23,
    "category_id" => 3,
    "description" => "Pagamento Cartão",
    "type" => "expense",
    "value" => "25000.20",
    "due_at" => "2019-10-02",
    "repeat_when" => "single",
    "period" => "month",
    "enrollments" => "1",
]);

//read
$invoices->read(91);

//update
$invoiceId = 91;
$invoices->update($invoiceId, [
    "wallet_id" => 23,
    "category_id" => 3,
    "description" => "Pagamento Cartão",
    "value" => "25000.20",
    "due_day" => 25,
    "status" => "paid"
]);

//delete
$invoices->delete(91);

//test and result
if ($invoices->error()) {
    $invoices->error(); //object
} else {
    $invoices->response(); //object
}

其他

您还有用于投资组合和签名的端点类,所有使用说明和实际示例文档都可在examples文件夹中找到。请查阅。

您还有用于投资组合和签名的端点类,所有使用说明和实际示例文档都可在该库的examples文件夹中找到。请查阅。

贡献

有关详细信息,请参阅CONTRIBUTING

支持

安全:如果您发现任何安全问题,请通过电子邮件meu@email.com.br反馈,而不是使用问题跟踪器。

如果您发现任何安全问题,请通过电子邮件delassitenciatec@gmail.com反馈,而不是使用问题跟踪器。

谢谢

鸣谢

许可协议

MIT许可(MIT)。请参阅许可文件获取更多信息。