masdimdev/omnipay-ipay88
Composer 安装命令:
composer require masdimdev/omnipay-ipay88
包简介
iPay88 driver for Omnipay
README 文档
README
Important: This implementation is based on the iPay88 Online Payment Switching Gateway (OPSG) Technical Specification, Version 1.6.4.4. Ensure compatibility with your integration requirements and verify if this version aligns with the gateway setup provided by iPay88.
An Omnipay driver for integrating with the iPay88 payment gateway, supporting features such as purchase, completePurchase, and requeryPayment.
Getting Started
Install via Composer:
composer require masdimdev/omnipay-ipay88
Set up the gateway:
$gateway = Omnipay::create('Ipay88'); $gateway->setMerchantCode('your-merchant-code'); $gateway->setMerchantKey('your-merchant-key');
Available Methods
purchase
Redirects the user to the iPay88 payment page for completing a transaction.
Required Data
| Parameter | Type | Description |
|---|---|---|
transactionId |
string |
Unique transaction/order ID |
amount |
integer |
Payment amount in cents (e.g., 100 = RM1.00) |
description |
string |
Description of the product or service |
userName |
string |
Payer's full name |
userEmail |
string |
Payer's email address |
userContact |
string |
Payer's contact number |
returnUrl |
string |
URL to redirect the user after payment |
notifyUrl |
string |
URL for iPay88 to notify transaction status |
Optional Data
| Parameter | Type | Description |
|---|---|---|
paymentId |
integer |
Payment ID. See getPaymentIds() method for available payment IDs |
remark |
string |
Remark |
Example
$response = $gateway->purchase([ 'transactionId' => 'ABC-12345', 'amount' => 100, 'description' => 'Test Product', 'userName' => 'John Doe', 'userEmail' => 'john@example.com', 'userContact' => '0123456789', 'returnUrl' => 'https://your-app.com/returnUrl', 'notifyUrl' => 'https://your-app.com/notifyUrl', ])->send(); if ($response->isRedirect()) { $response->redirect(); // Redirect to iPay88 payment page }
Response Methods
isRedirect(): Indicates if the response contains a redirection URL (iPay88 payment page).redirect(): Redirect to iPay88 payment page.getRedirectUrl(): Gets the redirect destination url.getRedirectMethod(): Get the required redirect method (either GET or POST).getRedirectData(): Gets the redirect form data array, if the redirect method is POST.getRedirectResponse(): Returns a POST form to redirect the user to iPay88.
completePurchase
Verifies the transaction status by handling the response from iPay88 after the user completes payment.
Example
$response = $gateway->completePurchase()->send(); if ($response->isSuccessful()) { echo 'Transaction successful'; } else { echo 'Transaction failed'; }
Response Methods
isSuccessful(): Indicates if the transaction was successfully verified.isSignatureValid(): Indicates if the response signature was valid.getTransactionId(): Returns the merchant transaction/order ID.getTransactionReference(): Returns the iPay88 transaction reference number.getData(): Returns the iPay88 transaction response.getFullData(): Returns mapped iPay88 transaction response.
requery
Checks the status of a transaction and returns the transaction status.
Required Data
| Parameter | Type | Description |
|---|---|---|
transactionId |
string |
Unique transaction/order ID |
amount |
integer |
Payment amount in cents |
Example
$response = $gateway->requery([ 'transactionId' => 'ABC-12345', 'amount' => 100, ])->send(); if ($response->isSuccessful()) { echo 'Transaction successful: ' . $response->getMessage(); } else { echo 'Transaction failed: ' . $response->getMessage(); }
Response Methods
isSuccessful(): Indicates if the transaction was successful (00).getMessage(): Returns a human-readable message about the transaction status.getCode(): Returns the raw response code (e.g.,00,Record not found, etc.).
requeryPayment
Retrieves detailed information about specific transactions.
Required Data
| Parameter | Type | Description |
|---|---|---|
transactionId |
string |
Unique transaction/order ID |
amount |
integer |
Payment amount in cents |
Example
$response = $gateway->requery([ 'transactionId' => 'ABC-12345', 'amount' => 100, ])->send(); if ($response->isSuccessful()) { echo 'Transaction successful: ' . $response->getMessage(); } else { echo 'Transaction failed: ' . $response->getMessage(); }
Response Methods
isSuccessful(): Indicates if the transaction was successfully verified.getTransactionId(): Returns the merchant transaction/order IDgetTransactionReference(): Returns the iPay88 transaction reference number.getData(): Returns the iPay88 transaction response.getFullData(): Returns mapped iPay88 transaction response.
getPaymentIds
Get list of available payment method/payment ID.
Example
$gateway->getPaymentIds(); print_r($paymentMethods);
Note: Some payment methods may not be available for your merchant, please contact iPay88 for more information.
License
This package is open-source software licensed under the MIT License.
masdimdev/omnipay-ipay88 适用场景与选型建议
masdimdev/omnipay-ipay88 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 masdimdev/omnipay-ipay88 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 masdimdev/omnipay-ipay88 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-14