Giter Site home page Giter Site logo

mpay24-php's Introduction

mpay24-php

Packagist

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****', '*********');

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

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-php's People

Contributors

tobiaslins avatar netbull avatar stefanpolzer avatar schoradt avatar chesio avatar

Watchers

Mike Bunzel 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.