2017 © Pedro Peláez
 

silverstripe-vendormodule checkout

Adds a 'checkout' to a SilverStripe site which links to an Estimate and adds the ability to setup and pay

image

silvercommerce/checkout

Adds a 'checkout' to a SilverStripe site which links to an Estimate and adds the ability to setup and pay

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 114 % Grown

The README.md

SilverCommerce Checkout Module

Adds a checkout process, to allow users to pay for an Estimate using configured omnipay payment gateways., (*1)

Also allows you to overwrite the process so you can add more custom payment integration., (*2)

Install

Install this module using composer:, (*3)

composer require silvercommerce/checkout, (*4)

Usage

By default, this module works with silvercommerce/shoppingcart out of the box. But it is fairly simple to use it to create payment workflows for a custom estimate if required., (*5)

Paying for a custom estimate

If you want to create a payment flow for a custom estimate, you simply have to create the estimate, add some items, add it to the checkout and then redirect. This can be done with a simple bit of code., (*6)

The example below has a custom controller that creates an estimate from a pre-defined product and then redirects to the checkout:, (*7)

use SilverStripe\Core\Injector\Injector;
use SilverCommerce\Checkout\Control\Checkout;
use SilverCommerce\OrdersAdmin\Factory\OrderFactory;

class ProductRedirectController extends PageController
{
    public function init()
    {
        parent::init();

        $product = $this->Product(); // Instance of SilverCommerce\CatalogueAdmin\CatalogueProduct
        $factory = OrderFactory::create();
        $factory->addItem($product);
        $factory->write();

        $checkout = Injector::inst()->get(Checkout::class);
        $checkout->setEstimate($factory->getOrder());

        $this->redirect($checkout->Link());
    }
}

The Versions

19/07 2018

1.0.x-dev

1.0.9999999.9999999-dev http://github.com/silvercommerce/checkout

Adds a 'checkout' to a SilverStripe site which links to an Estimate and adds the ability to setup and pay

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe shop payments ecommerce commerce checkout