Download the PHP package iget-master/cielo-checkout without Composer

On this page you can find all versions of the php package iget-master/cielo-checkout. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cielo-checkout

Cielo Checkout

This package provides simple integration with Cielo Checkout on Laravel 5.x.

To use it, you must have a Cielo Merchant ID. If you don't have one, please see the Cielo Checkout docs. Cielo may require homologation before enabling your production account.

Installation

To get started, install Cielo Checkout via the Composer package manager:

composer require iget-master/cielo-checkout

If you are using Laravel version older then 5.5, you must include our Service Provider to your config/app.php file under providers section:

Iget\CieloCheckout\ServiceProvider::class,

The Cielo Checkout service provider registers its own database migrations directory with the framework, so you should migrate your database after registering the provider. The Cielo Checkout migrations will create the tables needed to store Cielo orders.

php artisan migrate

Next, you should call the Cielo::routes() method withing the boot method of your RouteServiceProvider at the end of the map() method. This method will register the necessary routes to allow receiving transaction and status change notifications from Cielo.

This method accepts an optional $options parameter to setup the routes how you want. You can also call it inside a Route::group() callback if necessary.

<?php
/** ... */
use Cielo;
class RouteServiceProvider extends ServiceProvider
{
    /** ... */
    public function map()
    {
        $this->mapApiRoutes();
        $this->mapWebRoutes();
        Cielo::routes();
    }
    /** ... */
}

Under Cielo Checkout control panel (Vendas Online -> Cielo Checkout -> Configurações -> Pagamentos) , you should configure the notification type (Tipo de Notificação) to POST, the notification url (URL de Notificação) and status change url (URL de Mudança de Status) to respectively:

https://yourdomain.com/cielo/notify
https://yourdomain.com/cielo/status

This allows Cielo to notify your application when a CieloOrder was paid, or when it status changed.

Usage

The first step is to create a CieloOrder:

use Iget\CieloCheckout\Order\Cart;
use Iget\CieloCheckout\Order\Customer;
use Iget\CieloCheckout\Order\Item;
use Iget\CieloCheckout\Order\Shipping;

public function someControllerMethod()
{
    $order = Cielo::make()
        ->setSoftDescriptor('Descriptor') // Max 13 alphanumeric characters without whitespaces. Underline is allowed.
        ->setCart(function(Cart $cart) {
            $cart->add(new Item('My item label', 345.00, 1, Item::TYPE_ASSET);
        })
        ->setShipping(function(Shipping $shipping) {
            $shipping->setType(Shipping::TYPE_WITHOUT);
        })
        ->setCustomer(function(Customer $customer) { // Optional
            $customer->setIdentity('12345678900') // CPF or CNPJ
                ->setFullname('Fulano de tal')
                ->setEmail('[email protected]')
                ->setPhone('123456789');
        });

    $payableModel = YourOrderModel::find(3232);

    // This will create a new CieloOrder model, and associate it to your $payableModel.
    // If successful, this will generate an URL to where you should redirect your user.
    $redirectUrl = $order->request($payableModel);

    return response()->redirectTo($redirectUrl);
}

When your client pay the order, your application will be notified. You can watch the Iget\CieloCheckout\Events\PaymentStatusHasChanged event to make your logic after receiving the payment.

The event will give you access to the public properties: $cieloOrder, $oldStatus and $newStatus.

Disclaimer

This package is free and open source. The package author don't have any relation with Cielo (trademark) and isn't responsible for any consequences caused by it usage.


All versions of cielo-checkout with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^8.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iget-master/cielo-checkout contains the following files

Loading the files please wait ....