mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
36 lines
878 B
PHP
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);
|
|
}
|
|
}
|