ossbrownie/carts-guru

Recover Your Abandoned Carts and Turn Them into Sales.

0.0.6 2018-05-16 16:43 UTC

This package is auto-updated.

Last update: 2024-11-21 20:38:28 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Scrutinizer Code Quality Coverage Status Build Status

Recover Your Abandoned Carts and Turn Them into Sales.

curl

A basic CURL wrapper for PHP (see http://php.net/curl for more information about the libcurl extension for PHP)

Requirements

  • PHP >= 5.3
  • EXT-CURL = *

Usage

$cartsGuru = new CartsGuru(
    new HTTPClient(
        new CurlClient(),
        new Config(array(
            'apiAuthKey' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        ))
    ),
    'site-id-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
);

$item = new Item(array(
    'id' => 'test-item-0008',
    'label' => 'product',
    'quantity' => 1,
    'totalATI' => 200,
    'totalET' => 150,
    'url' => 'http://site.com/product/0008',
    'imageUrl' => 'http://site.com/product/0008.jpg',
));

$cart = new Cart(
    array(
        'id' => 'test-cart-0008',
        'totalATI' => 200,
        'totalET' => 150,
        'accountId' => '3847569834',
        'firstname' => 'Tester',
        'email' => 'test@site.com',
        'country' => 'United States',
        'countryCode' => 'USA',
    )
);
$cart->addItem($item);
$status = $cartsGuru->trackCart($cart);

$order = new Order(
    array(
        'id' => 'test-order-0008',
        'cartId' => 'test-cart-0008',
        'totalATI' => 200,
        'totalET' => 150,
        'state' => 'approved',
        'accountId' => '3847569834',
        'firstname' => 'Tester',
        'email' => 'test@site.com',
        'country' => 'United States',
        'countryCode' => 'USA',
    )
);
$order->addItem($item);
$status = $cartsGuru->trackOrder($order);

Contact

Problems, comments, and suggestions all welcome: oss.brownie@gmail.com