andrei930/mobilpay 问题修复 & 功能扩展

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

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

andrei930/mobilpay

Composer 安装命令:

composer require andrei930/mobilpay

包简介

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

README 文档

README

Laravel 5 (5.6 supported) mobilpay wrapper around omnipay with omnipay-mobilpay driver

Table of Contents

Installation

Composer

Add to your composer.json file.

{
    "require": {
        "andrei930/mobilpay": "^1.1.0"
    }
}

Run composer update to get the latest version of the package.

Laravel

Mobilpay comes with a service provider for Laravel. You'll need to add it to your composer.json as mentioned in the above steps, then register the service provider with your application.

Open config/app.php and find the providers key. Add MobilpayServiceProvider to the array.

...
Adrianbarbos\Mobilpay\MobilpayServiceProvider::class,
...

Add the required aliases to the list of class aliases in the same file.

...
'Omnipay' => Omnipay\Omnipay::class,
'Mobilpay'	=> Adrianbarbos\Mobilpay\Mobilpay::class,
...

Publish config.

php artisan vendor:publish --provider="Adrianbarbos\Mobilpay\MobilpayServiceProvider"

Basic Usage

Initiating Payment Request

// controller function

Mobilpay::setOrderId(1)
        ->setAmount('10.00')
        ->setDetails('Some details')
        ->purchase();

Handle Reponse

// controller function

$response = Mobilpay::response();

$data = $response->getData(); //array

switch($response->getMessage())
{
    case 'confirmed_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "pending"

        break;
    case 'paid_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "pending"

        break;
    case 'paid': // transaction is pending authorization. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "open/preauthorized"

        break;
    case 'confirmed': // transaction is finalized, the money have been captured from the customer's account

        //update DB, SET status = "confirmed/captured"

        break;
    case 'canceled': // transaction is canceled

        //update DB, SET status = "canceled"

        break;
    case 'credit': // transaction has been refunded

        //update DB, SET status = "refunded"

        break;
}	                

Options

Order id

/**
 * @param $value string
 * @return $this
 */

public function setOrderId($value)

Amount

/**
 * @param $value string
 * @return $this
 */

public function setAmount($value)

Currency

/**
 * @param $value string
 * @return $this
 */

public function setCurrency($value)

Details

/**
 * @param $value string
 * @return $this
 */

public function setDetails($value)

Confirm Url

/**
 * @param $value string
 * @return $this
 */

public function setConfirmUrl($value)

Return Url

/**
 * @param $value string
 * @return $this
 */

public function setReturnUrl($value)

Test Mode

/**
 * @param $value boolean
 * @return $this
 */

public function setTestMode($value)

Additional Params

/**
 * @param $value array
 * @return $this
 */

public function setAdditionalParams($value)

andrei930/mobilpay 适用场景与选型建议

andrei930/mobilpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 194 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 06 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 andrei930/mobilpay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 andrei930/mobilpay 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-27