定制 dadapas/mvola-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dadapas/mvola-php

最新稳定版本:1.3.1

Composer 安装命令:

composer require dadapas/mvola-php

包简介

A simple class wrapper for MVola mobile money for Madagascar.

README 文档

README

mvola api

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

PHP class wrap up Madagascar mobile money request as mvola.

This package facilitate these features for you:

  • Handle authentification token and expires token
  • Generate automaticly correlation ID and reference for payement
  • Request handler

Getting started

The suggested installation method is via composer:

composer require dadapas/mvola-php

To get started

require_once __DIR__ . "/vendor/autoload.php";
use MVolaphp\Telma as MVola;

$credentials = array(
	// Customer id
	'client_id'		=> '<customer_id>',
	// Customer secret
	'client_secret'		=> '<customer_secret>',
	// The merchant number
	'merchant_number'	=> '0343500003',
	// Set true to production
	'production'	  	=> false,
	// company_name
	'partner_name'		=> "company_name",
	// Set the lang
	'lang'				=> 'MG'
);

// Path to cache that is enable to read and write
$cache = __DIR__.'/cache';

try {

	$mvola = new MVola($credentials, $cache);

	// ...
} catch (MVolaphp\Exception $e) {

	echo $e->getMessage().PHP_EOL;

	var_dump($e->getData());
}

Sending money to merchent like

use MVolaphp\Money;
use MVolaphp\Objects\{Phone, PayIn, KeyValue};
...

$payDetails = new PayIn();

// Amount of 1000 ar or arivo ariary
$money = new Money('MGA', 5000);

$payDetails->amount = $money;

// User to retreive the amount
$debit = new KeyValue();
$debit->addPairObject(new Phone("0343500004"));
$payDetails->debitParty = $debit;

// Credited party not obligatoire if has been set in options

// $merchant = new KeyValue();
// $merchant->addPairObject(new Phone("0343500004"));
// $payDetails->creditParty = $merchant;

// Set description text
$payDetails->descriptionText = "Test payement";

$meta = new KeyValue();
$meta->add('partnerName', "Company name");
// $meta->add('fc', 'USD');
// $meta->add('amountFc', 1);

// Add metadata information
$payDetails->metadata = $meta;

// Put callback url
$mvola->setCallbackUrl("https://example.com/mycallback");

// Make a payement 	
$response = $mvola->payIn($payDetails);

print_r($response);

For testing only msisdn 034 35 000 03 and 034 35 000 04 work Use real number for production

Support

This repository is support to all php project, Symfony, Laravel, Codeigniter, Wordpress, ..., and so on

Documentation

To read the documentation is in

Contributing

Please read the CONTRIBUTING.md contents if you wish to help out!

LICENCE

MIT Licence

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固