register_widget_type( new Better_Payment_Widget() ); } /** * Elementor form integration * * @since 0.0.1 */ public function elementor_form_integration() { if(!defined('ELEMENTOR_PRO_VERSION')){ return false; } wp_enqueue_style( 'better-payment-common-style' ); \ElementorPro\Modules\Forms\Module::instance()->add_form_action( 'better-payment', new Payment_Amount_Integration() ); \ElementorPro\Modules\Forms\Module::instance()->add_form_action( 'PayPal', new Paypal_Integration() ); \ElementorPro\Modules\Forms\Module::instance()->add_form_action( 'Stripe', new Stripe_Integration() ); \ElementorPro\Modules\Forms\Module::instance()->add_form_action( 'Paystack', new Paystack_Integration() ); \ElementorPro\Modules\Forms\Module::instance()->add_form_field_type( 'payment_amount', new Payment_Amount_Field() ); } /** * Elementor pro form response * * @since 0.0.1 */ public function elementor_pro_form_response( $settings, $obj ) { wp_enqueue_style( 'better-payment-el' ); $response = Handler::manage_response( $settings, $obj->get_id() ); if ( $response ) { $obj->add_render_attribute( 'form', 'style', 'display:none' ); return false; } } }