Giter Club home page Giter Club logo

omnipayv3bridge's Introduction

OmnipayBridge

Build Status Total Downloads Latest Stable Version

Omnipay created by Adrian Macneil. The lib provides unified api for 25+ gateway gateways. Plus, it simple, has unified, consistent API and fully covered with tests. This bridge allows you to use omnipay gateways but in payum like way.

Why should you use this bridge?

Here's an example from omnipay's repository:

<?php
use Omnipay\Omnipay;

$gateway = Omnipay::create('Stripe');
$gateway->setApiKey('abc123');

$formData = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123'];
$response = $gateway->purchase(['amount' => '10.00', 'currency' => 'USD', 'card' => $formData])->send();

if ($response->isSuccessful()) {
    // payment was successful: update database
    print_r($response);
} elseif ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

and this is same code but done with the bridge:

<?php
use Payum\Core\PayumBuilder;
use Payum\Core\Request\Capture;
use Payum\Core\Request\GetHumanStatus;
use Payum\Core\Model\ArrayObject;

$payum = (new PayumBuilder())
    ->addDefaultStorages()
    ->addGateway('stripe', ['factory' => 'omnipay_stripe', 'apiKey' => 'abc123'])
    ->getPayum()
;

$card = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123'];
$payment = new ArrayObject(['amount' => '10.00', 'currency' => 'USD', 'card' => $card]);

if ($reply = $payum->getGateway('stripe')->execute(new Capture($payment), true)) {
    // convert reply to http response
}

$payum->getGateway('stripe')->execute($status = new GetHumanStatus($payment));
if ($status->isCaptured()) {
    // success
}

Well more or less same amount of code but with the bridge you get more out of the box:

  • Return\Cancel urls are generated just of the box. The urls are unique and do not expose any sensitive information.
  • If you do not pass credit card, Payum asks a user for it, showing the page with the form.
  • You can use Payum's packages for Symfony,Laravel,Silex,Zend,Yii with the bridge.
  • Storages. Your payment is already stored on the filesystem. We advice not to use this storage in prod.
  • The payment model contains all the information we were able to get from omnipay. Just use it.
  • Payum abstracts workflow. It knows when Omnipay's purchase or purchaseComplete methods should be used.
  • Credit card details are protected from accidental storing on your side.
  • Using the builder you can overwrite any part you want, or add a Payum extension.

Resources

Developed by Forma-Pro

Forma-Pro is a full stack development company which interests also spread to open source development. Being a team of strong professionals we have an aim an ability to help community by developing cutting edge solutions in the areas of e-commerce, docker & microservice oriented architecture where we have accumulated a huge many-years experience. Our main specialization is Symfony framework based solution, but we are always looking to the technologies that allow us to do our job the best way. We are committed to creating solutions that revolutionize the way how things are developed in aspects of architecture & scalability.

If you have any questions and inquires about our open source development, this product particularly or any other matter feel free to contact at [email protected]

License

OmnipayBridge is released under the MIT License.

omnipayv3bridge's People

Contributors

achudzinski avatar aderuwe avatar afurculita avatar aitboudad avatar belmeopmenieuwesim avatar chris8934 avatar dpfaffenbauer avatar joshbmarshall avatar koemeet avatar makasim avatar pierredup avatar ruslan-polutsygan avatar stloyd avatar studiomax avatar tetragramat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

omnipayv3bridge's Issues

Remove Guzzle 6

I just remembered that Guzzle 7 is incompatible with php-http/guzzle6-adapter.
Maybe it is easier to release a new major version of payum/omnipay-v3-bridge, in which the requirement of guzzlehttp/guzzle and php-http/guzzle6-adapter is removed. And instead add a suggest section in composer.json indicating the need to install any compatible Http Client like:
composer require payum/omnipay-v3-bridge php-http/guzzle7-adapter

Version constraint to payum/core

Hi,

wouldn't it be good idea to change the version constraint in v3-bridge from

"payum/core": "^1.3"

to

"payum/core": "^1.4.3"

as well?

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.