Coder Social home page Coder Social logo

yannkechichian / payum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from payum/payum

0.0 1.0 0.0 3.21 MB

PHP 5.3+ Payment processing framework. Paypal, Stripe, Payex, Authorize.NET, Be2bill, Klarna, recurring paymens, instant notifications and many more

Home Page: http://payum.org/doc#Core

License: MIT License

PHP 100.00%

payum's Introduction

Payum

Build Status Total Downloads Latest Stable Version

It is all about payments. The vision is to provide end solution keeping high level of a customization. It would be handy tool not only for basic tasks like capture or refund but for recurring payments or instant notifications as well.

Resources

Examples

Purchase

<?php
use Payum\Core\Model\Order;
use Payum\Core\Reply\HttpRedirect;
use Payum\Core\Reply\HttpResponse;
use Payum\Core\Request\Capture;
use Payum\Offline\PaymentFactory as OfflinePaymentFactory;

$order = new Order;
$order->setTotalAmount(100);
$order->setCurrencyCode('USD');

$payment = OfflinePaymentFactory::create();

if ($reply = $payment->execute(new Capture($order), true)) {
    if ($reply instanceof HttpRedirect) {
        header("Location: ".$reply->getUrl());
    } elseif ($reply instanceof HttpResponse) {
        echo $reply->getContent();
    } else {
        throw new \LogicException('Unsupported reply.', null, $reply);
    }
}

Get status

<?php
use Payum\Core\Request\GetHumanStatus;

$payment->execute($status = new GetHumanStatus($order));

echo $status->getValue();

Other operations.

<?php
use Payum\Core\Request\Authorize;
use Payum\Core\Request\Cancel;
use Payum\Core\Request\Refund;

$payment->execute(new Authorize($order));

$payment->execute(new Refund($order));

$payment->execute(new Cancel($order));

Storage

<?php
use Payum\Core\Storage\FilesystemStorage;
use Payum\Core\Extension\StorageExtension;
use Payum\Core\Model\Order;

$order = new Order;
$order->setTotalAmount(100);
$order->setCurrencyCode('USD');
$order->setNumber(uniqid());

$storage = new FilesystemStorage(sys_get_temp_dir(), get_class($order), 'number');

$payment->addExtension(new StorageExtension($storage));

// do execute

Contributing

Payum is an open source, community-driven project. Pull requests are very welcome.

Like it? Spread the word!

Star payum on github or packagist.

License

Payum is released under the MIT License.

payum's People

Contributors

66ton99 avatar achudzinski avatar aderuwe avatar afurculita avatar aitboudad avatar alexandernst avatar ateixeira avatar bm13kk avatar cesaredamico avatar christheyounger avatar cordoval avatar crevillo avatar eymengunay avatar jcroll avatar kg-itembase avatar makasim avatar minioak avatar mtudor avatar pborreli avatar ruslan-polutsygan avatar skadabr avatar smarques avatar staabm avatar stefanorg avatar stloyd avatar timo-linde avatar vkartaviy avatar winzou 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.