Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.17 KB

ReadMe.md

File metadata and controls

64 lines (45 loc) · 1.17 KB

Monetico PHP SDK

This library aims to facilitate the usage of Monetico Payment Service

Installation

Requirements

  • PHP 7.0

You can install the package via composer:

composer require dansmaculotte/monetico-php

Usage

use DansMaCulotte\Monetico\Monetico;

$monetico = new Monetico(
    'EPT_CODE',
    'SECURITY_KEY',
    'COMPANY_CODE',
    'RETURN_URL',
    'RETURN_SUCCESS_URL',
    'RETURN_ERROR_URL'
);
use DansMaCulotte\Monetico\Payment\Payment;

$payment = new Payment(array(
    'reference' => 'ABCDEF123',
    'description' => 'Documentation',
    'language' => 'FR',
    'email' => '[email protected]',
    'amount' => 42,
    'currency' => 'EUR',
    'datetime' => Carbon::create(2019, 1, 1),
));

$url = $monetico->getPaymentUrl();
$fields = $monetico->getPaymentFields($payment);
Use DansMaCulotte\Monetico\Payment\Response;
use DansMaCulotte\Monetico\Payment\Receipt;

// $data = json_decode($body, true);

$response = new Response($data);

$result = $monetico->validateSeal($response);

$receipt = new Receipt($result);

License

The MIT License (MIT). Please see License File for more information.