| 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 WC_Order; |
| 14 |
|
| 15 |
/** |
| 16 |
* Handle use cases related to payment methods |
| 17 |
*/ |
| 18 |
interface Interface_Payment_Method_Service { |
| 19 |
|
| 20 |
/** |
| 21 |
* Get identification form |
| 22 |
*/ |
| 23 |
public function get_identification_form( WC_Order $order ): ?SeQuraForm; |
| 24 |
|
| 25 |
/** |
| 26 |
* Get payment methods |
| 27 |
* |
| 28 |
* @return array<string, string>[] |
| 29 |
*/ |
| 30 |
public function get_payment_methods( ?WC_Order $order = null ): array; |
| 31 |
|
| 32 |
/** |
| 33 |
* Get a list of all payment methods defined for store and merchant |
| 34 |
* |
| 35 |
* @return array<string, string>[] See PaymentMethodsResponse::toArray() output |
| 36 |
*/ |
| 37 |
public function get_all_payment_methods( ?string $store_id, ?string $merchant ): array; |
| 38 |
|
| 39 |
/** |
| 40 |
* Check if the payment method data matches a valid payment method. |
| 41 |
*/ |
| 42 |
public function is_payment_method_data_valid( Payment_Method_Data $data ): bool; |
| 43 |
|
| 44 |
/** |
| 45 |
* Look for available payment methods which can be used with the widget |
| 46 |
* |
| 47 |
* @return array<string, string>[] |
| 48 |
*/ |
| 49 |
public function get_all_widget_compatible_payment_methods( string $store_id, ?string $merchant ): array; |
| 50 |
|
| 51 |
/** |
| 52 |
* Look for available payment methods that can be used with part payments |
| 53 |
* |
| 54 |
* @throws Throwable |
| 55 |
* |
| 56 |
* @return array<string, string>[] |
| 57 |
*/ |
| 58 |
public function get_all_mini_widget_compatible_payment_methods( string $store_id, ?string $merchant ): array; |
| 59 |
|
| 60 |
/** |
| 61 |
* Check if the current page is the order pay page |
| 62 |
*/ |
| 63 |
public function is_order_pay_page(): bool; |
| 64 |
|
| 65 |
/** |
| 66 |
* Check if the current page is the checkout page |
| 67 |
*/ |
| 68 |
public function is_checkout(): bool; |
| 69 |
} |
| 70 |
|