kevinpurwito/laravel-rajabiller
Composer 安装命令:
composer require kevinpurwito/laravel-rajabiller
包简介
Rajabiller integration for Laravel
README 文档
README
Laravel Rajabiller is a package that integrates Rajabiller for Laravel.
Refer to this docs & this postman
Installation
You can install the package via composer:
composer require kevinpurwito/laravel-rajabiller
Configuration
The vendor:publish command will publish a file named kp_rajabiller.php within your laravel project config
folder config/kp_rajabiller.php.
Published Config File Contents
[
'env' => strtolower(env('KP_RB_ENV', 'dev')), // dev or prod
'url' => strtolower(env('KP_RB_URL', 'https://rajabiller.fastpay.co.id/transaksi/json_devel.php')),
'uid' => env('KP_RB_UID'),
'pin' => env('KP_RB_PIN'),
];
Alternatively you can ignore the above publish command and add this following variables to your .env file.
KP_RB_ENV=dev
KP_RB_UID=user
KP_RB_PIN=secret
Auto Discovery
If you're using Laravel 5.5+ you don't need to manually add the service provider or facade. This will be
Auto-Discovered. For all versions of Laravel below 5.5, you must manually add the ServiceProvider & Facade to the
appropriate arrays within your Laravel project config/app.php
Provider
[
Kevinpurwito\LaravelRajabiller\RajabillerServiceProvider::class,
];
Alias / Facade
[
'Rajabiller' => Kevinpurwito\LaravelRajabiller\Facades\Rajabiller::class,
];
Publishing the migration
Aside from migrations, you shouldn't need to publish the others, such as seeders and config; unless you want to customize them
php artisan vendor:publish --provider=Kevinpurwito\LaravelRajabiller\RajabillerServiceProvider --tag=rb-migrations
Running the seeders
php artisan db:seed --class=Kevinpurwito\LaravelRajabiller\Database\Seeders\RbSeeder
Dev Credentials
UID=FA9919
PIN=123321
Using the command
This package comes with a built-in command for you to call to sync items in the database to Rajabiller's servers. This command maintains the pricing and availability of the items. You can call this command in Laravel CronJob.
php artisan rb-sync-items
Usage
use Kevinpurwito\LaravelRajabiller\Facades\Rajabiller; // returns the balance that you have Rajabiller::getBalance(); // returns the list of orders you created in certain date (accepts date in Y-m-d format) Rajabiller::orders('2021-01-20'); // returns the list of items under certain group (accepts string groupCode) Rajabiller::groupItems('TELKOMSEL'); // returns the details of item (accepts string itemCode) Rajabiller::item('S5H'); // telkomsel pulsa 5rb // purchase an item, either pulsa or game voucher Rajabiller::purchase('TXxxx', 'S5H', '628xxxx', 'pulsa'); // telkomsel pulsa 5rb // inquiry for ppob (PLN, TELKOM, etc) price before paying Rajabiller::inquiry('TXxxx', 'PLN', '123xxxx'); // pay for ppob (PLN, TELKOM, etc) Rajabiller::pay('TXxxx', 'PLN', '123xxxx');
Be careful! You can only do 3 inquiries per day for 1 customerId for each item. For example. you can only inquire about a PLN charge for 1 customerId 3 times, after that you have to pay it or inquire again tomorrow.
Handling the response
use Kevinpurwito\LaravelRajabiller\Facades\Rajabiller; $response = Rajabiller::item('S5H'); // telkomsel pulsa 5rb if ($response->getStatusCode() == 200) { // if you want to check the response body, such as `HARGA` you can do this: $content = json_decode($response->getBody()->getContents()); dump($content); // { // "KODE_PRODUK": "S5H", // "UID": "UID", // "PIN": "PIN", // "STATUS": "00", // "KET": "SUKSES", // "HARGA": "5435", // "ADMIN": "", // "KOMISI": "0", // "PRODUK": "TELKOMSEL SIMPATI / AS 5RB", // "STATUS_PRODUK": "AKTIF", // } }
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email kevin.purwito@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the PHP Package Boilerplate by Beyond Code with some modifications inspired from PHP Package Skeleton by spatie.
kevinpurwito/laravel-rajabiller 适用场景与选型建议
kevinpurwito/laravel-rajabiller 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.86k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 10 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「kevinpurwito」 「rajabiller」 「ppob」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kevinpurwito/laravel-rajabiller 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kevinpurwito/laravel-rajabiller 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kevinpurwito/laravel-rajabiller 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PhpConstant is a simple class containing useful functions which you can extend to your constant classes.
Country list migration, seeders and model for Laravel
Zenziva integration for Laravel
Mailcoach API integration for Laravel
Alfabank REST API integration
Allow your users to login with their Web3 wallets
统计信息
- 总下载量: 1.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-25