cyvelnet/laravel-billplz 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cyvelnet/laravel-billplz

Composer 安装命令:

composer require cyvelnet/laravel-billplz

包简介

Flexible billing and payment solution from Billplz for laravel

README 文档

README

StyleCI Build Status Latest Stable Version Latest Unstable Version License

Laravel-billplz is a simple service providers and generator to connect your laravel powered app to Billplz api v3.

Before you getting started, kindly visit https://www.billplz.com/enterprise/signup to register an acount and read https://www.billplz.com/api#v3 for better understanding.

Install

Require this package with composer using the following command:

composer require cyvelnet/laravel-billplz

After updating and installed, add the service provider to the providers array in config/app.php file

Cyvelnet\LaravelBillplz\LaravelBillplzServiceProvider::class

And finally add the facade to the aliases array section in config/app.php

Cyvelnet\LaravelBillplz\Facades\Billplz::class

How to use

Bills api

Create a bill
To create a billplz bill
\Billplz::issue(function (Cyvelnet\LaravelBillplz\Messages\BillMessage $bill)
    {
        // bill with a amount RM50
        $bill->to('name', 'email', 'mobile')
             ->amount(50) // will multiply with 100 automatically, so a RM500 bill, you just pass 500 instead of 50000
             ->callbackUrl('http://foorbar.com/foo/bar/webhook/')
             ->description('description');
    });

An UnacceptableRequestException will be throw for any call with any missing parameter.

Alternatively, you may generate reusable bill with artisan command php artisan make:bill MonthlyManagementBill

\Billplz::send(new MonthlyManagementBill())
        ->to('foobar')
        ->viaEmail('foo@bar.com') // you may use viaSms('mobile no') or viaEmailAndSms('email', 'mobile no')
To delete an existing bill
$request = \Billplz::delete('bill_id');

if($request->isSuccess())
{
    // perform after deletion operation 
}
To retrieves a bill
$bill = \Billplz::get('bill_id')->toArray();

A BillNotFoundException will be throw for any missing bill.

Collections api

To create a collection
    $request = \Billplz::collection('collection title');
    
    if($request->isSuccess())
    {
        $collection = $request->toArray() // you can call getRawBillplzResponse(false) to get response in POPO
    }

to customize your collection more, pass in an anonymous function as the second parameter

    $request = \Billplz::collection('collection title', function (\Cyvelnet\LaravelBillplz\Messages\CollectionMessage $collection) {
    
        // split a payment by RM50
        $collection->logo(storage_path('/billplz/my-logo.jpg'))
                   ->splitPaymentByFixed('foo@bar.com', 50)     // will convert into 5000 cents automatically
    });
To create an open collection with fixed amount
    // create a open collection with a fixed amount RM500
    $request = \Billplz::openCollection('collection title', 'collection description', 500);
    
    if($request->isSuccess())
    {
        $collection = $request->toArray() // you can call getRawBillplzResponse(false) to get response in POPO
    }
To create an open collection with any amount and any quantity pass a closure as third parameter
    // create a open collection with a fixed amount RM500
    $request = \Billplz::openCollection('collection title', 'collection description', function (\Cyvelnet\LaravelBillplz\Messages\OpenCollectionMessage $collection) {
    
        $collection->anyAmountAndQty();
        //         ->splitPaymentByVariable('foo@bar.com', 50);  // split payment by 50%
        //         ->tax(6)   // 6% tax
        //         ->photo(storage_path('/billplz/my-photo.jpg'))
        //         ->reference1('your references')
    
    });
    
    if($request->isSuccess())
    {
        $collection = $request->toArray() // you can call getRawBillplzResponse(false) to get response in POPO
    }

Sandbox

Billplz api v3, enabled sandbox functionality where developers are allowed to isolates api request to a sandbox and trigger payment completion on demand.

By default sandbox is disabled, to enable sandbox mode add a BILLPLZ_ENABLE_SANDBOX = true entry to .env and ensure you have proper configured api_key and collection_id for both production and sandbox.

cyvelnet/laravel-billplz 适用场景与选型建议

cyvelnet/laravel-billplz 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 701 次下载、GitHub Stars 达 7, 最近一次更新时间为 2016 年 09 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 cyvelnet/laravel-billplz 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-19