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

Skip to content
forked from Payum/Payum

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

License

Notifications You must be signed in to change notification settings

carlosbergfeld/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\Request\Capture;
use Payum\Core\Request\GetHumanStatus;
use Payum\Core\Model\Order;
use Payum\Offline\PaymentFactory as OfflinePaymentFactory;

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

$payment = (new OfflinePaymentFactory())->create();

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

$status->isCaptured();

Paypal Purchase

<?php
use Payum\Core\Request\Capture;
use Payum\Core\Request\GetHumanStatus;
use Payum\Core\Model\Order;
use Payum\Paypal\ExpressCheckout\PaymentFactory as PaypalPaymentFactory;

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

$payment = (new PaypalPaymentFactory())->create();

try {
    $payment->execute(new Capture($order));
    $payment->execute($status = new GetHumanStatus($order));
    
    $status->isCaptured();
} catch (HttpRedirectReply $reply) {
    header("Location: ".$reply->getUrl());
    exit;
}

Get Payment details

<?php
var_dump($order->getDetails());

Authorize, Refund and so on

<?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

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

http://payum.org/doc#Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%