Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ Payum Public
forked from Payum/Payum

Domain friendly payment framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

License

Notifications You must be signed in to change notification settings

winzou/Payum

 
 

Repository files navigation

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.

About

Domain friendly payment framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%