Пример #1
0
/**
 * This section contains param's examples for cart's methods
 *
 * @see http://docs.api2cart.com/cart
 */
/**
 * cart.create
 *
 * @see http://docs.api2cart.com/cart-create
 */
$params = array('cart_id' => 'BigcommerceApi', 'store_url' => 'http://example.com', 'verify' => 'false', 'store_key' => 'ab37fc230bc5df63a5be1b11220949be', 'AdminAccount' => 'admin', 'ApiPath' => 'http://example.com/api/v1', 'ApiKey' => '6b89704cd75738cb0f9f6468d5462aba');
try {
    /**
     * Return stdClass
     */
    $result = $api->request('cart.create', $params);
    echo 'Store Key: ' . $result->store_key;
} catch (Exception $e) {
    echo '#' . $e->getCode() . ' ' . $e->getMessage();
}
/**
 * cart.validate
 *
 * @see http://docs.api2cart.com/cart-validate
 */
try {
    /**
     * Return stdClass
     */
    $result = $api->request('cart.validate');
    echo 'Status: ' . $result->status;