定制 lifenpag/asaas-php 二次开发

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

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

lifenpag/asaas-php

Composer 安装命令:

composer require lifenpag/asaas-php

包简介

LifenPag's Asaas PHP Library

README 文档

README

This is not an official Asaas library

Installation

composer require lifenpag/asaas-php

Create Client

<?php
use LifenPag\Asaas\V3\Client;
use LifenPag\Asaas\V3\Domains\Customer as CustomerDomain;
use LifenPag\Asaas\V3\Entities\Customer as CustomerEntity;
use LifenPag\Asaas\V3\Collections\Customer as CustomerCollection;

Client::connect('your_api_key', 'sandbox|production');

Customer

Create Customer By Entity

$customer = new CustomerEntity();
$customer->name = 'Homer Simpson';
$customer->email = 'homer.simpson@lifenpag.com';

$customerCreated = $customer->create();

Create Customer By Domain

$customer = new CustomerEntity();
$customer->name = 'Homer Simpson';
$customer->email = 'homer.simpson@lifenpag.com';

$customerCreated = CustomerDomain::create($customer)->get();
// or
$customer = new CustomerEntity((object) ["name" => "test", "email" => "email@test.com"];

$customerCreated = CustomerDomain::create($customer)->get();

Update Customer

$customerEntity = CustomerDomain::update(['name' => 'Homer Simpson Updated'], 'customer_id')->get();

Update Customer Nested

$customerEntity = new CustomerEntity();
$customerEntity->name = 'Homer Simpson';
$customerEntity->email = 'homer.simpson@lifenpag.com';
$customerEntity->cpfCnpj = '85267610054';

// Creating customer
$customer = CustomerDomain::create($customerEntity)->get();

// Updating object customer
$customerUpdated = $customer->update(['name' =>'Homer Jay Simpson']);

Delete Customer

$customerEntity = CustomerDomain::delete('customer_id')->get();

Delete Customer Nested

$customerEntity = CustomerDomain::find('customer_id')->get();

$customerEntityDeleted = $customerEntity->delete();

Restore Customer

$customerEntity = CustomerDomain::restore('customer_id')->get();

Restore Customer Nested

$customerEntity = CustomerDomain::find('customer_id')->get();

$customerEntityRestored = $customerEntity->restore();

Get All Customers

$customerCollection = CustomerDomain::all();

Get Customers By Filters

$customerCollection = CustomerDomain::where(['limit' => 3]);

Update in loop Example

$customerCollection = CustomerDomain::where(['limit' => 3]);

$customerCollection->map(function ($customer) {
	$customerUpdated = $customer->update(['name' => 'nested updated']);
});

Payment

Create Payment By Entity

$payment = new PaymentEntity();
$payment->customer = 'customer_id';
$payment->billingType = 'BOLETO';
$payment->value = 100;
$payment->dueDate = (new DateTime())->format('Y-m-d');
$paymentCreated = $payment->create();

Create Payment By Customer Domain (doPayment)

$customer = new CustomerEntity();
$customer->name = 'Homer Simpson';
$customer->email = 'homer.simpson@lifenpag.com';
$customer->cpfCnpj = '85267610054';

$payment = new PaymentEntity();
$payment->billingType = 'BOLETO';
$payment->value = 100;
$payment->dueDate = (new DateTime())->format('Y-m-d');

$paymentCreated = CustomerDomain::create($customer)->doPayment($payment);

Get Payment

$payment = PaymentDomain::find('pay_id')->get();

Get Payment With Digitable Line

$payment = PaymentDomain::find('pay_id')->get()->populateDigitableLine();

Credits

This project was created by Breno Vieira Soares from LifenPag. Feel free to contribute to the project

lifenpag/asaas-php 适用场景与选型建议

lifenpag/asaas-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.65k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2020 年 10 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「api」 「Guzzle」 「Asaas」 「LifenPag」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lifenpag/asaas-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lifenpag/asaas-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 lifenpag/asaas-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-04