PluginProbe
MultiSafepay plugin for WooCommerce / trunk
MultiSafepay plugin for WooCommerce vtrunk
6.11.1 6.12.0 6.13.0 6.2.0 6.2.1 6.3.0 6.3.1 6.4.0 6.4.1 6.4.2 6.4.3 6.5.0 6.5.1 6.6.0 6.6.1 6.6.2 6.7.0 6.7.1 6.7.2 6.7.3 6.8.0 6.8.1 6.8.2 6.8.3 6.9.0 All 84 releases
multisafepay / src / PaymentMethods / Base / BaseGiftCardPaymentMethod.php

BaseGiftCardPaymentMethod.php in MultiSafepay plugin for WooCommerce trunk, at src/PaymentMethods/Base/BaseGiftCardPaymentMethod.php

48 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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