mpay24/mpay24-php 问题修复 & 功能扩展

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

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

mpay24/mpay24-php

Composer 安装命令:

composer require mpay24/mpay24-php

包简介

Offical PHP SDK for SOAP Bindings

README 文档

README

Packagist Packagist Version Packagist Downloads

Offical PHP SDK for SOAP Bindings

Documentation

A short demo implementation guide is available at https://docs.mpay24.com/docs/get-started
Documentation is available at https://docs.mpay24.com/docs.

Composer

You can install the bindings via Composer. Run the following command:

composer require mpay24/mpay24-php

To use the bindings, use Composer's autoload:

require __DIR__ . '/vendor/autoload.php';

Manual Installation

If you do not want to use Composer, you can download the latest release. Then, to use the bindings, include the bootstrap.php file.

require_once('bootstrap.php');

SDK overview

Configuration

You can use the config.php file in the root directory

You also can handover the parameters while crating the Mpay24 Object

require_once("../bootstrap.php");
use Mpay24\Mpay24;
use Mpay24\Mpay24Order; //if you are using paymentPage

$mpay24 = new Mpay24('9****', '*********', TRUE); //Testsystem
$mpay24 = new Mpay24('7****', '*********', FALSE); //Livesystem

If you want to have a more flexible approach you can create a configuration object.

Create a token for seamless creditcard payments

$tokenizer = $mpay24->token("CC");
$tokenizerLocation = $tokenizer->getLocation();
$token = $tokenizer->getToken();

Create a payment

Creditcard payment with a token

$payment = array(
  "amount" => "100",
  "currency" => "EUR",
  "token" => $_POST['token']
);
$result = $mpay24->payment("TOKEN", "123 TID", $payment);

Paypal payment

$payment = array(
  "amount" => "100",
  "currency" => "EUR"
);
$result = $mpay24->payment("PAYPAL", "123 TID", $payment);

Create a payment page

Initialize a minimum payment page

use Mpay24\Mpay24Order;

$mdxi = new Mpay24Order();
$mdxi->Order->Tid = "123";
$mdxi->Order->Price = "1.00";
$mdxi->Order->URL->Success      = 'http://yourpage.com/success';
$mdxi->Order->URL->Error        = 'http://yourpage.com/error';
$mdxi->Order->URL->Confirmation = 'http://yourpage.com/confirmation';

$paymentPageURL = $mpay24->paymentPage($mdxi)->getLocation(); // redirect location to the payment page

header('Location: '.$paymentPageURL);

How to work with ORDER objects

Get current transaction status

Using the Pull method

With the unique mPAYTID number that we send back in the response messages

$mpay24->paymentStatus("12345");

With the TID that we received by the merchant request If you don't have unique TID you will only get the last transaction with this number

$mpay24->paymentStatusByTID("123 TID");

Prerequisites

In order for the Mpay24 PHP SDK to work, your installation will have to meet the following prerequisites:

Please refer to http://www.php.net/phpinfo or consult your systems administrator in order to find out if your system fulfills the prerequisites.

mpay24/mpay24-php 适用场景与选型建议

mpay24/mpay24-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 219.64k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2017 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 219.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 8
  • 依赖项目数: 9
  • 推荐数: 4

GitHub 信息

  • Stars: 13
  • Watchers: 5
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-24