| 1 |
<?php declare( strict_types=1 ); |
| 2 |
|
| 3 |
namespace MultiSafepay\WooCommerce\PaymentMethods\Base; |
| 4 |
|
| 5 |
use MultiSafepay\Api\PaymentMethods\PaymentMethod; |
| 6 |
use MultiSafepay\WooCommerce\Utils\Logger; |
| 7 |
use WC_Order; |
| 8 |
|
| 9 |
/** |
| 10 |
* Class BaseGiftCardPaymentMethod |
| 11 |
* |
| 12 |
* @package MultiSafepay\WooCommerce\PaymentMethods\Base |
| 13 |
*/ |
| 14 |
class BaseGiftCardPaymentMethod extends BasePaymentMethod { |
| 15 |
|
| 16 |
/** |
| 17 |
* BaseGiftCardPaymentMethod constructor. |
| 18 |
* |
| 19 |
* @param PaymentMethod $payment_method |
| 20 |
* @param Logger|null $logger |
| 21 |
*/ |
| 22 |
public function __construct( PaymentMethod $payment_method, ?Logger $logger = null ) { |
| 23 |
parent::__construct( $payment_method, $logger ); |
| 24 |
if ( ! $this->get_option( $this->get_payment_method_id() . '_gift_card_max_amount_updated', false ) ) { |
| 25 |
$this->update_option( 'max_amount', '' ); |
| 26 |
$this->update_option( $this->get_payment_method_id() . '_gift_card_max_amount_updated', '1' ); |
| 27 |
$this->max_amount = ''; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* @param WC_Order $order |
| 33 |
* @return bool |
| 34 |
*/ |
| 35 |
public function can_refund_order( $order ): bool { |
| 36 |
return false; |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Return if payment component is enabled. |
| 41 |
* |
| 42 |
* @return bool |
| 43 |
*/ |
| 44 |
public function is_payment_component_enabled(): bool { |
| 45 |
return false; |
| 46 |
} |
| 47 |
} |
| 48 |
|