PluginProbe
HyperPay Payments / trunk
HyperPay Payments vtrunk
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / src / Traits / HyperpayBlocks.php

HyperpayBlocks.php in HyperPay Payments trunk, at src/Traits/HyperpayBlocks.php

47 lines 949 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hyperpay\Gateways\Traits;
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6
7 trait HyperpayBlocks
8 {
9 public $isExpress = false;
10 public $isDynamicCheck = false;
11 public $supports = ["products"];
12 public $action_button = '';
13
14
15
16 public function canMakePayment()
17 {
18 return wp_send_json(["canMakePayment" => true]);
19 }
20
21 /**
22 * Initializes the payment method type.
23 */
24
25 public function initialize()
26 {
27 }
28
29 public function extraScriptData()
30 {
31 return [];
32 }
33
34 /**
35 * Check if the store uses blocks on the cart or checkout page.
36 *
37 * @return boolean
38 */
39 public static function has_checkout_block()
40 {
41 $checkout_id = wc_get_page_id('checkout');
42 $has_classic_checkout = $checkout_id && has_block('woocommerce/classic-shortcode', $checkout_id);
43
44 return !$has_classic_checkout;
45 }
46 }
47