PHP code example of cielowp / api-3.0-php

1. Go to this page and download the library: Download cielowp/api-3.0-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cielowp / api-3.0-php example snippets



Cielo\API30\Ecommerce\CreditCard;


CieloWP\CieloWP;
use CieloWP\Gateway\Gateway;
use CieloWP\Order\Order;

$order_cielo = new Order($this->get_app_env(), $this->merchant_id, $this->merchant_key,
						 $order->get_total(), $order_id, Gateway::TYPE_CREDIT_CARD);
$returnCielo = CieloWP::process_payment($order_cielo);

//return
//$returnCielo['success']
//$returnCielo['error']


CieloWP\CieloWP;
use CieloWP\Gateway\Gateway;
use CieloWP\Order\Order;

$order_cielo = new Order($this->get_app_env(), $this->merchant_id, $this->merchant_key, $order->get_total(),
                         $order_id, Gateway::TYPE_DEBIT_CARD, $this->get_api_return_url($order));
$returnCielo = CieloWP::process_payment($order_cielo);

//returno
//$returnCielo['success']
//$returnCielo['error']

composer