用于与SaaS FSPHP的webservice集成的API库

1.0.0 2023-03-27 11:55 UTC

This package is auto-updated.

Last update: 2024-09-27 17:06:13 UTC


README

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

ItxApi库是在UpInside的全栈PHP开发者培训中开发的一组小类,用于集成到课程中开发的SaaS平台webservice。

ItxApi库是在UpInside的全栈PHP开发者培训中开发的一组小类,用于集成到课程中开发的SaaS平台webservice。

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

亮点

  • 简单安装
  • 所有API方法的抽象
  • 使用用户名和密码轻松认证
  • Composer就绪且符合PSR-2规范

安装

通过Composer提供Uploader

"juniormagalhaesti/itxapi": "^1.0"

或运行

composer require juniormagalhaesti/itxapi

文档

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

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

用户端点

<?php

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

use juniormagalhaesti\itxapi\Me;

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

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

//update
$user->update([
    "first_name" => "Robson",
    "last_name" => "Leite",
    "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 juniormagalhaesti\itxapi\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

支持

安全:如果您发现任何与安全相关的问题,请通过电子邮件junior.magalhaes09@gmail.com联系,而不是使用问题跟踪器。

如果您发现任何与安全相关的问题,请通过电子邮件junior.magalhaes09@gmail.com联系,而不是使用问题跟踪器。

谢谢

鸣谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件