fruitcakestudio/omnipay-pesapal 问题修复 & 功能扩展

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

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

fruitcakestudio/omnipay-pesapal

Composer 安装命令:

composer require fruitcakestudio/omnipay-pesapal

包简介

Pesapal Omnipay gateway

README 文档

README

Skeleton gateway for the Omnipay PHP payment processing library

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements pesapal support for Omnipay.

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Install

Via Composer

$ composer require fruitcakestudio/omnipay-pesapal:"1.x@alpha"

Usage

The following gateways are provided by this package:

  • Pesapal

For general usage instructions, please see the main Omnipay repository.

Example

bootstrap.php

require 'vendor/autoload.php';

$gateway = \Omnipay\Omnipay::create('Pesapal');
$gateway->initialize(array(
    'key' => 'your-consumer-key',
    'secret' => 'your-consumer-secret',
    'testMode' => false,
));

purchase.php

require 'bootstrap.php';

// Make a purchase request
$response = $gateway->purchase(array(
    'amount' => "6.84",
    'description' => "Testorder #1234",
    'currency' => 'USD',
    'card' => array(
        'email' => 'barry@fruitcakestudio.nl',
        'firstName' => 'Barry',
        'lastName' => 'vd. Heuvel',
        'phone' => '+1234567890',
    ),
    'returnUrl' => 'http://my-domain.com/return.php',
))->send();

$transactionId = $response->getTransactionId();

if ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo "Error " .$response->getCode() . ': ' . $response->getMessage();
}

return.php

require 'bootstrap.php';

// Check the payment status
$response = $gateway->completePurchase()->send();

// Show status to user
if ($response->isSuccessful()) {
    echo "Transaction '" . $response->getTransactionId() . "' succeeded!";
} else {
    echo "Status: " .$response->getCode() . ': ' . $response->getMessage();
}

notify.php

require 'bootstrap.php';

// Check the payment status
$response = $gateway->completePurchase()->send();

$reference = $response->getTransactionReference();  // TODO; Check the reference/id with your database
$transactionId = $response->getTransactionId();

if($response->isSuccessful()){
   // Save state
}

// Return message for the gateway
echo $response->getNotificationMessage();   // Or ->getNotificationResponse() for Symfony Response

The transactionReference is pesapal_transaction_tracking_id, which is set by Pesapal. The transactionId is your own id (pesapal_merchant_reference), which will be generated if not provided.

See the documentation on http://developer.pesapal.com/how-to-integrate/step-by-step

Sandbox / Demo

When you set testMode to true, the Demo sandbox will be used.

You need a different consumer key/secret. Follow these steps to use the testMode:

  • Create a business account on http://demo.pesapal.com/
  • Login to your demo account, the key/secret are on the dashboard.
  • Start a transaction and send dummy money
  • Use the same phonenumber (eg. 700123456) and amount. Copy the confirmation code after submitting.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

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.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@fruitcake.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

fruitcakestudio/omnipay-pesapal 适用场景与选型建议

fruitcakestudio/omnipay-pesapal 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 66 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「omnipay」 「pesapal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 fruitcakestudio/omnipay-pesapal 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-26