PluginProbe
seQura / 3.2.0
seQura v3.2.0
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 / Payment / interface-payment-method-service.php

interface-payment-method-service.php in seQura 3.2.0, at src/Services/Payment/interface-payment-method-service.php

72 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Payment method service interface
4 *
5 * @package SeQura/WC
6 * @subpackage SeQura/WC/Services
7 */
8
9 namespace SeQura\WC\Services\Payment;
10
11 use SeQura\Core\BusinessLogic\Domain\Order\Models\SeQuraForm;
12 use SeQura\WC\Dto\Payment_Method_Data;
13 use SeQura\WC\Dto\Payment_Method_Option;
14 use WC_Order;
15
16 /**
17 * Handle use cases related to payment methods
18 */
19 interface Interface_Payment_Method_Service {
20
21 /**
22 * Get identification form
23 */
24 public function get_identification_form( WC_Order $order ): ?SeQuraForm;
25
26 /**
27 * Get payment methods
28 *
29 * @return Payment_Method_Option[]
30 */
31 public function get_payment_methods( ?WC_Order $order = null );
32
33 /**
34 * Get a list of all payment methods defined for store and merchant
35 *
36 * @param bool $cache Use cache if available.
37 * @return array<string, string>[] See PaymentMethodsResponse::toArray() output
38 */
39 public function get_all_payment_methods( ?string $store_id, ?string $merchant, $cache = false ): array;
40
41 /**
42 * Check if the payment method data matches a valid payment method.
43 */
44 public function is_payment_method_data_valid( ?Payment_Method_Data $data ): bool;
45
46 /**
47 * Look for available payment methods which can be used with the widget
48 *
49 * @return array<string, string>[]
50 */
51 public function get_all_widget_compatible_payment_methods( string $store_id, ?string $merchant ): array;
52
53 /**
54 * Look for available payment methods that can be used with part payments
55 *
56 * @throws Throwable
57 *
58 * @return array<string, string>[]
59 */
60 public function get_all_mini_widget_compatible_payment_methods( string $store_id, ?string $merchant ): array;
61
62 /**
63 * Check if the current page is the order pay page
64 */
65 public function is_order_pay_page(): bool;
66
67 /**
68 * Check if the current page is the checkout page
69 */
70 public function is_checkout(): bool;
71 }
72