承接 kevinpurwito/laravel-rajabiller 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kevinpurwito/laravel-rajabiller

Composer 安装命令:

composer require kevinpurwito/laravel-rajabiller

包简介

Rajabiller integration for Laravel

README 文档

README

Tests Code Style Psalm Latest Version on Packagist Total Downloads

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 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-25