ferdhika31/ipaymu-php
Composer 安装命令:
composer require ferdhika31/ipaymu-php
包简介
PHP Client for iPaymu API
关键字:
README 文档
README
iPaymu API wrapper written in PHP for access from applications.
Documentation
For the API documentation, please check iPaymu API Documentation.
Installation
Install the package with composer by following command:
composer require ferdhika31/ipaymu-php
Usage
Initialization
Configure package with your account's secret key obtained from iPaymu Dashboard. You can use production or sandbox environment.
<?php use ferdhika31\iPaymuPHP\iPaymu; $config = [ 'env' => 'SANDBOX', // SANDBOX or PRODUCTION 'virtual_account' => 'your_virtual_account', 'api_key' => 'your_api_key', 'notify_uri' => 'http://localhost:8000/notify', // for redirect payment is required 'cancel_uri' => 'http://localhost:8000/cancel', 'return_uri' => 'http://localhost:8000/return' ]; iPaymu::init($config);
See example codes for more details.
Get Balance
<?php use ferdhika31\iPaymuPHP\Balance; $getBalance = Balance::getBalance();
Set Customer
<?php $customer = [ 'name' => 'Dika', 'email' => 'fer@dika.web.id', 'phone' => '083213123332' ]; iPaymu::setCustomer($customer);
Add Product
<?php iPaymu::addProduct([ 'name' => 'Mangga', 'qty' => 2, 'price' => 2500, 'description' => 'Mangga cobian' ]); iPaymu::addProduct([ 'name' => 'Jeruk', 'qty' => 1, 'price' => 1500, 'description' => 'Jeruk haseum' ]);
Create Redirect Payment
<?php use ferdhika31\iPaymuPHP\PaymentRedirect; // optional $payloadTrx = [ 'expired' => 1, // in hours 'comments' => 'Transaction comment here', 'referenceId' => 'TRX202008310001' ]; $redirectPayment = PaymentRedirect::create($payloadTrx);
Create Redirect Payment with Payment Method
<?php use ferdhika31\iPaymuPHP\PaymentRedirect; // optional $payloadTrx = [ 'expired' => 1, // in hours 'comments' => 'Transaction comment here', 'referenceId' => 'TRX202008310001' ]; $redirectPayment = PaymentRedirect::mandiriVA()->create($payloadTrx); $redirectPayment = PaymentRedirect::niagaVA()->create($payloadTrx); $redirectPayment = PaymentRedirect::BNIVA()->create($payloadTrx); $redirectPayment = PaymentRedirect::BAGVA()->create($payloadTrx); $redirectPayment = PaymentRedirect::BCATransfer()->create($payloadTrx); $redirectPayment = PaymentRedirect::QRIS()->create($payloadTrx); $redirectPayment = PaymentRedirect::CStore()->create($payloadTrx); $redirectPayment = PaymentRedirect::creditCard()->create($payloadTrx); $redirectPayment = PaymentRedirect::COD()->create($payloadTrx); $redirectPayment = PaymentRedirect::akulaku()->create($payloadTrx);
Create Direct Payment
<?php use ferdhika31\iPaymuPHP\PaymentDirect; $payloadTrx = [ 'amount' => 5000, // optional 'expired' => 10, 'expiredType' => 'minutes', // in:seconds,minutes,hours,days 'comments' => 'Transaction comment here', 'referenceId' => 'TRX202008310001' ]; // Available channel Virtual Account : bag, bni, cimb (default), mandiri $channel = 'mandiri'; $directPayment = PaymentDirect::VA($channel)->create($payloadTrx); // Available channel Transfer Bank : bca (default) $channel = 'bca'; $directPayment = PaymentDirect::bankTransfer($channel)->create($payloadTrx); // Available channel Convenience Store : indomaret (default), alfamart $channel = 'alfamart'; $directPayment = PaymentDirect::cStore($channel)->create($payloadTrx); // Available channel: linkaja (default) $channel = 'linkaja'; $directPayment = PaymentDirect::QRIS($channel)->create($payloadTrx);
Get Transaction Detail
<?php use ferdhika31\iPaymuPHP\Transaction; $id = 27958; $getTrx = Transaction::getById($id);
Running
Running test suite:
vendor\bin\phpunit tests vendor\bin\phpunit tests\BalanceTest.php
Running examples:
php examples\CheckBalanceExample.php
Contributing
For any requests, bugs, or comments, please open an issue or submit a pull request.
ferdhika31/ipaymu-php 适用场景与选型建议
ferdhika31/ipaymu-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 93 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 11 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「payment gateway」 「ipaymu」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ferdhika31/ipaymu-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ferdhika31/ipaymu-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ferdhika31/ipaymu-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 93
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-25