Files
FOSSBilling/src/modules/Cart/Api/Client.php
T

36 lines
878 B
PHP

<?php
/**
* Copyright 2022-2023 FOSSBilling
* Copyright 2011-2021 BoxBilling, Inc.
* SPDX-License-Identifier: Apache-2.0
*
* @copyright FOSSBilling (https://www.fossbilling.org)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
namespace Box\Mod\Cart\Api;
/**
* Shopping cart management.
*/
class Client extends \Api_Abstract
{
/**
* Checkout a shopping cart that has products in it.
*
* @param array $data Checkout data
*
* @param int $data['gateway_id'] ID of the payment gateway to use for the payment
*
* @return mixed
*/
public function checkout($data)
{
$gateway_id = $data['gateway_id'] ?? null;
$cart = $this->getService()->getSessionCart();
$client = $this->getIdentity();
return $this->getService()->checkoutCart($cart, $client, $gateway_id);
}
}