pralhadstha/omnipay-fonepay 问题修复 & 功能扩展

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

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

pralhadstha/omnipay-fonepay

最新稳定版本:v1.0.0

Composer 安装命令:

composer require pralhadstha/omnipay-fonepay

包简介

Fonepay Omnipay Package for PHP applications

README 文档

README

Fonepay QR driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP.

Currently this package only implements Fonepay QR support for Omnipay. Fonepay functionality will be added soon.

Installation

Omnipay is installed via Composer.

To install, simply require league/omnipay and pralhadstha/omnipay-fonepay with Composer:

composer require league/omnipay pralhadstha/omnipay-fonepay

Basic Usage

Purchase

    use Omnipay\Omnipay;
    use Exception;

    $gateway = Omnipay::create('Fonepay_FonepayQr');

    $gateway->setUsername('fonepay_username_or_email');
    $gateway->setPassword('fonepay_password');
    $gateway->setMerchantCode('merchant_code_provided_by_fonepay');
    $gateway->setTestMode(false);

    try {
        $response = $gateway->purchase([
            'amount' => 1000.00,
            'productNumber' => "PN-100",
            'remarks1' => "Remark 1",
            'remarks2' => "Remark 2 if needed",
        ])->send();

        if ($response->isCustomRedirect()) {
            // provide the page to display the QR code.
        }
    } catch (Exception $e) {
        return $e->getMessage();
    }

Payment Complete

    $gateway = Omnipay::create('Fonepay_FonepayQr');

    $gateway->setUsername('fonepay_username_or_email');
    $gateway->setPassword('fonepay_password');
    $gateway->setMerchantCode('merchant_code_provided_by_fonepay');
    $gateway->setTestMode(false);

    try {
        $response = $gateway->completePurchase([
            'productNumber' => "PN-100",
        ])->send();

        if ($response->isSuccessful()) {
            // Payment is successful and will have fonepayTraceId.
        } else {
            // Payment is received as failed and need to again check if payment is completed.
        }
    } catch (Exception $e) {
        return $e->getMessage();
    }

Working Example

Want to see working examples before integrating them into your project? View the examples here

Official Doc

Please follow the Official Document provided by Fonepay to understand about the parameters and their descriptions. The document is not publicly available. Please contact Fonepay team for the documents.

Contributing

Contributions are welcome and will be fully credited.

Contributions can be made via a Pull Request on Github.

Support

If you are having general issues with Omnipay Khalti, drop an email to pralhad.shrestha05@gmail.com for quick support.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-25