PluginProbe
seQura / 3.0.5
seQura v3.0.5
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / src / Services / Cart / interface-cart-service.php

interface-cart-service.php in seQura 3.0.5, at src/Services/Cart/interface-cart-service.php

86 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Cart service interface
4 *
5 * @package SeQura/WC
6 * @subpackage SeQura/WC/Services
7 */
8
9 namespace SeQura\WC\Services\Cart;
10
11 use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\DiscountItem;
12 use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\HandlingItem;
13 use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\OtherPaymentItem;
14 use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\ProductItem;
15 use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\ServiceItem;
16 use SeQura\WC\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\Registration_Item;
17 use SeQura\WC\Dto\Cart_Info;
18 use WC_Order;
19 use WC_Product;
20
21 /**
22 * Handle use cases related to cart
23 */
24 interface Interface_Cart_Service {
25
26 /**
27 * Get closest desired first charge date from cart items
28 */
29 public function get_desired_first_charge_on( ?WC_Order $order = null ): ?string;
30
31 /**
32 * Get seQura cart info data from session. If not exists, then initialize it.
33 */
34 public function get_cart_info_from_session(): ?Cart_Info;
35
36 /**
37 * Attempt to clear seQura cart info data from session.
38 */
39 public function clear_cart_info_from_session(): void;
40
41 /**
42 * Get items in cart
43 *
44 * @return array<ProductItem|ServiceItem|Registration_Item>
45 */
46 public function get_items( ?WC_Order $order ): array;
47
48 /**
49 * Get products in cart
50 *
51 * @return array<WC_Product>
52 */
53 public function get_products( ?WC_Order $order ): array;
54
55 /**
56 * Get handling items
57 *
58 * @return HandlingItem[]
59 */
60 public function get_handling_items( ?WC_Order $order = null ): array;
61
62 /**
63 * Get discount items
64 *
65 * @return DiscountItem[]
66 */
67 public function get_discount_items( ?WC_Order $order = null ): array;
68
69 /**
70 * Get refund items
71 *
72 * @return OtherPaymentItem[]
73 */
74 public function get_refund_items( WC_Order $order = null ): array;
75
76 /**
77 * Create refund item instance
78 */
79 public function create_refund_item( ?int $id, float $amount ): OtherPaymentItem;
80
81 /**
82 * Check if conditions are met for showing seQura in checkout
83 */
84 public function is_available_in_checkout( ?WC_Order $order = null ): bool;
85 }
86