Git Product home page Git Product logo

transaction-plugin-manager's Introduction

Base package for Subscribo Transaction Plugins

Installation

Projects and Transaction plugins depending on this package should require it in their composer.json:

    "require": {
        "subscribo/transaction-plugin-manager": "@dev"
    }

You also might want to add TransactionPluginManagerServiceProvider in your bootstrap/app.php (but generally it is not necessary, as any added driver should register it.

    if (class_exists('\\Subscribo\\TransactionPluginManager\\Integration\\Laravel\\TransactionPluginManagerServiceProvider')) {
        $app->register('\\Subscribo\\TransactionPluginManager\\Integration\\Laravel\\TransactionPluginManagerServiceProvider');
    }

Usage

By transaction plugins

Transaction plugins should use interfaces provided by this package in Interface directory and may use base classes, provided by this package in Base directory

By projects

Controllers and other parts of projects may use interfaces and managers provided by this package.

Example code:

use Subscribo\ModelCore\Models\Transaction;
use Subscribo\TransactionPluginManager\Interfaces\PluginResourceManagerInterface;
use Subscribo\TransactionPluginManager\Managers\TransactionProcessingManager;


class SomeController
{
    public method actionProcessChargeTransaction($id, PluginResourceManagerInterface $resourceManager)
    {
        $transaction = Transaction::find($id);
        $driverName = $transaction->transactionGatewayConfiguration->transactionGateway->driver;
        $processingManager = new TransactionProcessingManager($resourceManager, $driverName);

        return $processingManager->charge($transaction);
    }
}

transaction-plugin-manager's People

Contributors

slavo2 avatar

Watchers

Michael G. Ströck avatar James Cloos avatar  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.