Coder Social home page Coder Social logo

mcpayment / mcp-php Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 25 KB

Official PHP package for MC Payment API.

Home Page: https://developer.mcpayment.id/

PHP 99.07% Shell 0.93%
credit-card ewallet payment payment-gateway php virtual-account mcpayment mcppayment-id

mcp-php's Introduction

MCP-PHP

This is the Official PHP package for MCPayment API. For more documentation available at https://developer.mcpayment.id.

1. Installation

Your application should meet minimum version of PHP ≥ 7.2.

‼️ This package not ready yet for production use ‼️

If you are using Composer, you can install via composer CLI:

composer require mcpayment/mcp-php

or

add this require line to your composer.json file:

{
    "require": {
        "mcpayment/mcp-php": "1.*"
    }
}

and run composer install on your terminal.

2. How to Use

General Settings

See .env.example for your env settings reference on your app. Then set it up for your headers's requests as below:

use MCPhp\Mcp;

Mcp::setApiEnv(MCP_ENV);
Mcp::setMerchantId(MCP_MERCHANT_INDEX);
Mcp::setSecretUnboundId(MCP_SECRET_UNBOUND_ID);
Mcp::setHashKey(MCP_HASH_KEY);
Mcp::setHeaders($externalId, $orderId);

Generate Transaction Link

Generate the transaction using CreateTransaction trait, this will return an object.Please refer to this Payment Page docs. Simply add this to your code:

use MCPhp\CreateTransaction;

CreateTransaction::generateLink($headers, $body));

Virtual Account

You can make OPEN and PARTIAL transaction's mode of virtual account with this. Simply add this to your code:

use MCPhp\VirtualAccounts;

Create

VirtualAccounts::create($headers, $body));

Payment

VirtualAccounts::pay($params);

Cancel

VirtualAccounts::cancel($headers, $params);

Inquiry

VirtualAccounts::inquiry($headers, $params);

3. Example

You can find the example at the examples folder

See documentation for details about headers and body requests.

mcp-php's People

Contributors

mcpayment avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.