承接 jesuferanmi/php-monicredit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jesuferanmi/php-monicredit

Composer 安装命令:

composer require jesuferanmi/php-monicredit

包简介

Monicredit Rest API php library

README 文档

README

Github top language License Github issues Github forks

About   |   Requirements   |   Usage   |   Contribution   |   License   |   Author


🎯 About

PHP Library for Monicredit API

✅ Requirements

Before starting 🏁, you need to have Git and PHP 7+ installed.

🏁 Usage

# Installation
$ composer require jesuferanmi/php-monicredit

ENV Configuration

Open your .env file and add your demo public key, live public key, demo private key, live private key, monicredit live and demo base url(You will find this in the api documentation. An example of the base url is: https://baseURL/api/) and monicredit environment('DEMO' or 'LIVE') like this:

MONICREDIT_DEMO_PUBLIC_KEY=""
MONICREDIT_DEMO_PRIVATE_KEY=""
MONICREDIT_LIVE_PUBLIC_KEY=""
MONICREDIT_LIVE_PRIVATE_KEY=""
MONICREDIT_ENVIRONMENT="DEMO"
MONICREDIT_DEMO_BASEURL=""
MONICREDIT_LIVE_BASEURL=""

If you are using a hosting service like heroku, ensure to add the above details to your configuration variables.

#Usage

  • Initiate Transaction
$monicredit = new Monicredit();

$customer = [
            'first_name' => 'Olasunkanmi',
            'last_name' => 'Feranmi',
            'email' => 'feranmiolasunkanmi91@gmail.com',
            'phone' => '0000000002'
        ];

$splitDetails = [
    'sub_account_code' => 'SB0000000',
    'fee_percentage' => 100,
    'fee_flat' => 0
];
$itemDetails = [
    "item" => 'Test Transaction',
    "revenue_head_code" => 'REV0000000',
    "unit_cost" => '300',
    "split_details" => array($splitDetails),
];

$payload = [
    'order_id' => rand(1000, 9000),
    'customer' => $customer,
    'items' => [$itemDetails],
    'feeBearer' => 'merchant'
];

$initiate = $monicredit->intiateTransaction($payload);
  • Verify Transaction
$monicredit = new Monicredit();

$payload = ["transaction_id" => "ACX000000"];

$verify = $monicredit->verifyTransaction($payload);
  • Get Transaction Info
$monicredit = new Monicredit();
$payload = "ACX000000";

$response = $monicredit->getInitiatedTransactionInfo();

🔨 Countribution

# fork and Clone the fork project
# Access the folder
$ cd monicredit-php

# Install dependencies
$ composer Install

# Create .env and update
$ cp .env.example .env

# Run test
$ vendor/bin/phpunit tests

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by Emmanuel Jesuferanmi

 

Todo:

  • Update Readme with Usage

Back to top

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固