sellkit
/
includes
/
elementor
/
modules
/
checkout
/
integrations
/
stripe-woocommerce-official.php
stripe-woocommerce-official.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.2.2, at includes/elementor/modules/checkout/integrations/stripe-woocommerce-official.php
| 1 | <?php |
| 2 | |
| 3 | namespace Sellkit\Elementor\Modules\Checkout\Integrations; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || die(); |
| 6 | |
| 7 | use Sellkit\Elementor\Modules\Checkout\Integrations\Integration; |
| 8 | |
| 9 | /** |
| 10 | * Integration class to integrate stripe woocommerce official with sellkit checkout widget. |
| 11 | * |
| 12 | * @since 1.1.0 |
| 13 | */ |
| 14 | class Stripe_Woocommerce_Official extends Integration { |
| 15 | /** |
| 16 | * Original plugin class holder. |
| 17 | * |
| 18 | * @since 1.1.0 |
| 19 | * @var object |
| 20 | */ |
| 21 | private $parent; |
| 22 | |
| 23 | /** |
| 24 | * Check requirement to enable gateway in sellkit checkout widget. |
| 25 | * |
| 26 | * @return bool |
| 27 | * @since 1.1.0 |
| 28 | */ |
| 29 | protected function requirements() { |
| 30 | // Plugin not installed. |
| 31 | if ( ! defined( 'WC_STRIPE_PLUGIN_PATH' ) ) { |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | if ( ! class_exists( 'WC_Stripe_Payment_Request' ) ) { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | $this->parent = \WC_Stripe_Payment_Request::instance(); |
| 40 | |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Content of express checkout methods. |
| 46 | * |
| 47 | * @return void |
| 48 | * @since 1.1.0 |
| 49 | */ |
| 50 | public function content() { |
| 51 | ?> |
| 52 | <div class="sellkit-stripe-woocommerce-official-integration" > |
| 53 | <?php $this->parent->display_payment_request_button_html(); ?> |
| 54 | </div> |
| 55 | <?php |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Hooks to integrate current gateway with sellkit checkout widget. |
| 60 | * |
| 61 | * @return void |
| 62 | * @since 1.1.0 |
| 63 | */ |
| 64 | public function hooks() { |
| 65 | remove_action( 'woocommerce_checkout_before_customer_details', [ 'WC_Stripe_Payment_Request', 'display_payment_request_button_html' ], 1 ); |
| 66 | remove_action( 'woocommerce_checkout_before_customer_details', [ 'WC_Stripe_Payment_Request', 'display_payment_request_button_separator_html' ], 2 ); |
| 67 | } |
| 68 | } |
| 69 |