From d31341bcc263fb7e1e705261a173a99f951e4fe0 Mon Sep 17 00:00:00 2001 From: Niraj Chaudhary <99162269+NirajChaudhary143@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:55:47 +0545 Subject: [PATCH] Dev- Square Payment Gateway (#1293) * Added - Square fields in free * Added - Active square feature from form builder * Added - Display error message when square is diabled * Added - Validation for square credit card * Added - Backward Compatibility * updated * Fix - Setting url * Added - Image added on dashboard * Tweak - Remove backward compatibility code * Tweak - Auto enable ajax in square payment --------- Co-authored-by: Deependra Chaudhary --- assets/css/admin.scss | 3 +- .../sections/all_extensions.json | 16 ++++++++ .../sections/images/square-payment.png | Bin 0 -> 10025 bytes assets/js/admin/evf-setup.js | 2 + assets/js/admin/form-builder.js | 2 - assets/js/admin/upgrade.js | 17 +++++++++ assets/js/frontend/ajax-submission.js | 18 +++++++++ changelog.txt | 1 + includes/admin/class-evf-admin-assets.php | 2 + includes/class-evf-form-task.php | 2 +- includes/class-evf-forms-features.php | 1 + .../fields/class-evf-field-payment-square.php | 36 ++++++++++++++++++ .../shortcodes/class-evf-shortcode-form.php | 2 +- readme.txt | 1 + 14 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 assets/extensions-json/sections/images/square-payment.png create mode 100644 includes/fields/class-evf-field-payment-square.php diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 27ba4f7a5..0feaaf131 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -2542,7 +2542,8 @@ &.turnstile_empty_key_validate, &.hcaptcha_empty_key_validate, &.enable-stripe-model, - &.enable-authorize-net-model { + &.enable-authorize-net-model, + &.enable-square-model{ opacity: 0.45; &:hover { diff --git a/assets/extensions-json/sections/all_extensions.json b/assets/extensions-json/sections/all_extensions.json index 359d6e5f5..3a0d51240 100644 --- a/assets/extensions-json/sections/all_extensions.json +++ b/assets/extensions-json/sections/all_extensions.json @@ -806,6 +806,22 @@ "setting_url": "admin.php?page=evf-settings&tab=integration§ion=pipedrive", "demo_video_url": "wJPX0EJ2OiI", "popular_rank": 32 + }, + { + "title": "Square", + "slug": "everest-forms-square", + "name": "Everest Forms - Square", + "image": "extensions-json/sections/images/square-payment.png", + "excerpt": "Connect your Everest Forms data to your Trello accounts. Use Trello API to link Everest Forms with Trello, syncing your website's form submissions with Trello tasks.", + "link": "https://docs.everestforms.net/docs/trello/?utm_source=dashboard-all-features&utm_medium=card-documentation-link", + "released_date": "20/05/2024", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=payment", + "demo_video_url": "" } ] } diff --git a/assets/extensions-json/sections/images/square-payment.png b/assets/extensions-json/sections/images/square-payment.png new file mode 100644 index 0000000000000000000000000000000000000000..e5fd1f2f60b205ee0d55ce2abb42f17967d208be GIT binary patch literal 10025 zcmeHtS5%X2w{1W`19k+l05(7&^d?AAP(+X_y(C5jD4{$91K(5Jnt%V&NbKjMql^t5%#m}5D4VRJ{DD5vH1~!;xCI#hnC=-~Sq3jMc^lqUgA{k2p9TM6ak`~* z3j!&N;@Ex23V{e>@7=y-6u?9ohsJ$?C&~T7a7OdC3cf%Z+|)mKJO1hIFQw3qt0`Tt zHEzaOo3LuMLVjmFi+pzB##Q#$%#jxkwHLpZ_!7xJQ;IKb7krGmx#}G{?WyaV9qZ#? zS4eX&p8uedD%Lk(Y->D23&Kt#CyM*X;iqj9CHxkKit6g>R92}8BBvmbnNmW<45dFu zr+#lkl~1x;X-#Qps>zo=xzQxCNJ_9(S=i{NaYGrp~{dq~ZMR3_LL3m=`8w=^B1)J@UZBY450`}GpFg{vi zYK!#!BKaU!SGfTKxydT!W_RDzltAQyK=N)1!n4EeESMlDt%z$7i2eyCZV0O25D2%? z9TY1hLzo!`ff%2#V}j)U1L1(&G-fe_KngB3Geh*b{`aH*w+N80LM{*C#ha`a8`iqK z=8G`#Lg~TfN-JMEN%^^H!rjVSR!MU177y*XZ2~6Czn;{V;h$=Y5?>10s>iz&7MYOK zL-&~_`kf{%S(&vgMN&R{Uc9(n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dU=?%mP7U94vJ?7sjjy+-i> literal 0 HcmV?d00001 diff --git a/assets/js/admin/evf-setup.js b/assets/js/admin/evf-setup.js index 24474a2ac..65cd7637a 100644 --- a/assets/js/admin/evf-setup.js +++ b/assets/js/admin/evf-setup.js @@ -124,6 +124,7 @@ jQuery(function ($) { page: pagenow, name: $itemRow.data("name"), slug: $itemRow.data("slug"), + is_feature : $itemRow.data('is_feature') }, }); }); @@ -509,6 +510,7 @@ jQuery(function ($) { page: pagenow, name: $(event).data("name"), slug: $(event).data("slug"), + is_feature : $( event ).data( 'is_feature' ) }, }); diff --git a/assets/js/admin/form-builder.js b/assets/js/admin/form-builder.js index 9b5bdbdfb..665003fb3 100644 --- a/assets/js/admin/form-builder.js +++ b/assets/js/admin/form-builder.js @@ -23,8 +23,6 @@ var $value = $(this).val(); $(this).val($value.replace(/<\s*script/gi, '').replace(/\s+on\w+\s*=/gi, ' ')); }); - - }); $( document ).ready( function( $ ) { diff --git a/assets/js/admin/upgrade.js b/assets/js/admin/upgrade.js index 87c7130c5..65deccab2 100644 --- a/assets/js/admin/upgrade.js +++ b/assets/js/admin/upgrade.js @@ -9,6 +9,7 @@ jQuery( function( $ ) { $( document.body ).on( 'click dragstart', '.evf-registered-item.evf-upgrade-addon', this.evf_upgrade_addon ); $( document.body ).on( 'click dragstart', '.evf-registered-item.enable-stripe-model', this.enable_stripe_model ); $( document.body ).on( 'click dragstart', '.evf-registered-item.enable-authorize-net-model', this.enable_authorize_net_model ); + $( document.body ).on( 'click dragstart', '.evf-registered-item.enable-square-model', this.enable_square_model ); $( document.body ).on( 'click dragstart', '.everest-forms-field-option-row.upgrade-modal', this.feature_upgrade ); $( document.body ).on( 'click dragstart', '.evf-upgradable-feature, .everest-forms-btn-group span.upgrade-modal', this.feature_upgrade ); $( document.body ).on( 'click dragstart', '.evf-one-time-draggable-field, .evf-registered-item.evf-one-time-draggable-field', this.evf_one_time_draggable_field ); @@ -200,6 +201,22 @@ jQuery( function( $ ) { } }); }, + enable_square_model : function ( e ){ + e.preventDefault(); + $.alert({ + title: evf_upgrade.enable_square_title, + content: evf_upgrade.enable_square_message, + icon: 'dashicons dashicons-info', + type: 'blue', + buttons : { + confirm : { + text: evf_data.i18n_close, + btnClass: 'btn-confirm', + keys: ['enter'] + } + } + }); + }, evf_one_time_draggable_field: function( e ){ e.preventDefault(); $.alert({ diff --git a/assets/js/frontend/ajax-submission.js b/assets/js/frontend/ajax-submission.js index 234c618b0..8895409c1 100644 --- a/assets/js/frontend/ajax-submission.js +++ b/assets/js/frontend/ajax-submission.js @@ -26,6 +26,19 @@ jQuery( function( $ ) { return false; } + //For square payment credit card validation. + var squareMsgContainer = formTuple.find(".everest-forms-gateway[data-gateway='square']").find('.sq-card-message-error'); + if ( squareMsgContainer.length > 0 ) { + var squareErrorMsg = squareMsgContainer.text(); + $( document ).ready( function() { + $( '#card-errors' ).html( squareErrorMsg ).show(); + $( '.evf-submit' ).text( 'Submit' ); + $( '.evf-submit' ).attr( 'disabled', false); + }); + formTuple.trigger( 'focusout' ).trigger( 'change' ).trigger( 'submit' ); + return false; + } + if ( typeof tinyMCE !== 'undefined' ) { tinyMCE.triggerSave(); } @@ -154,6 +167,11 @@ jQuery( function( $ ) { formTuple.trigger( 'evf_process_payment', xhr.data ); return; } + if( 'square' === formTuple.find( ".everest-forms-gateway[data-gateway='square']" ).data('gateway') ){ + formTuple.trigger( 'everest_forms_frontend_payment_before_success_message', xhr.data ); + return; + } + formTuple.trigger( 'reset' ); formTuple.closest( '.everest-forms' ).html( '' + quiz_reporting + preview_confirmation ).focus(); localStorage.removeItem(formTuple.attr('id')); diff --git a/changelog.txt b/changelog.txt index bd7ed378f..eda697f13 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ * Feature - Enable minimum time for form submission. * Feature - Delete option in Header logo in PDF Submission. * Enhancement - Custom file name field settings. +* Dev - Square Payment. * Dev - Transaction Table. * Dev - Salesflare into Module. * Dev - ConvertKit Compatibility. diff --git a/includes/admin/class-evf-admin-assets.php b/includes/admin/class-evf-admin-assets.php index fdd1c99f1..ebd6ba364 100644 --- a/includes/admin/class-evf-admin-assets.php +++ b/includes/admin/class-evf-admin-assets.php @@ -225,6 +225,8 @@ public function admin_scripts() { 'enable_stripe_message' => esc_html__( 'Enable Stripe Payment gateway in payments section to use this field.', 'everest-forms' ), 'enable_authorize_net_title' => esc_html__( 'Please enable Authorize.Net', 'everest-forms' ), 'enable_authorize_net_message' => esc_html__( 'Enable Authorize.Net Payment gateway in payments section to use this field.', 'everest-forms' ), + 'enable_square_title' => esc_html( 'Please enable Square', 'everest-forms' ), + 'enable_square_message' => esc_html__( 'Enable Square Payment gateway in payments section to use this field.', 'everest-forms' ), 'evf_install_and_active_nonce' => wp_create_nonce( 'install_and_active_nonce' ), 'upgrade_plan_title' => esc_html__( 'is a Premium Addon', 'everest-forms' ), 'upgrade_plan_message' => esc_html__( 'This addon requires premium plan. Please upgrade to the Premium plan to unlock all these awesome field.', 'everest-forms' ), diff --git a/includes/class-evf-form-task.php b/includes/class-evf-form-task.php index 89cd8f606..ceba8efb9 100644 --- a/includes/class-evf-form-task.php +++ b/includes/class-evf-form-task.php @@ -187,7 +187,7 @@ public function do_task( $entry ) { do_action( "everest_forms_process_before_{$form_id}", $entry, $this->form_data ); $ajax_form_submission = isset( $this->form_data['settings']['ajax_form_submission'] ) ? $this->form_data['settings']['ajax_form_submission'] : 0; - if ( isset( $this->form_data['payments']['stripe']['enable_stripe'] ) && '1' === $this->form_data['payments']['stripe']['enable_stripe'] ) { + if ( ( isset( $this->form_data['payments']['stripe']['enable_stripe'] ) && '1' === $this->form_data['payments']['stripe']['enable_stripe'] ) || ( isset( $this->form_data['payments']['square']['enable_square'] ) && '1' === $this->form_data['payments']['square']['enable_square'] ) ) { $ajax_form_submission = '1'; } if ( '1' === $ajax_form_submission ) { diff --git a/includes/class-evf-forms-features.php b/includes/class-evf-forms-features.php index c722870fe..506594372 100644 --- a/includes/class-evf-forms-features.php +++ b/includes/class-evf-forms-features.php @@ -60,6 +60,7 @@ public function form_fields( $fields ) { 'EVF_Field_Color', 'EVF_Field_Reset', 'EVF_Field_Lookup', + 'EVF_Field_Payment_Square', ); return array_merge( $fields, $pro_fields ); diff --git a/includes/fields/class-evf-field-payment-square.php b/includes/fields/class-evf-field-payment-square.php new file mode 100644 index 000000000..bf5df7cc7 --- /dev/null +++ b/includes/fields/class-evf-field-payment-square.php @@ -0,0 +1,36 @@ +name = esc_html__( 'Square', 'everest-forms' ); + $this->type = 'square-payment'; + $this->icon = 'evf-icon evf-icon-payment'; + $this->order = 231; + $this->group = 'payment'; + $this->is_pro = true; + $this->plan = 'personal agency themegrill-agency'; + $this->addon = 'everest-forms-square'; + $this->links = array( + 'image_id' => '', + 'vedio_id' => 'a5EcKjwWD1A', + ); + + parent::__construct(); + } +} diff --git a/includes/shortcodes/class-evf-shortcode-form.php b/includes/shortcodes/class-evf-shortcode-form.php index a47e89d3d..c13642993 100644 --- a/includes/shortcodes/class-evf-shortcode-form.php +++ b/includes/shortcodes/class-evf-shortcode-form.php @@ -906,7 +906,7 @@ private static function view( $atts ) { $form_enabled = isset( $form_data['form_enabled'] ) ? absint( $form_data['form_enabled'] ) : 1; $kff_enabled = isset( $settings['keyboard_friendly_form'] ) ? absint( $settings['keyboard_friendly_form'] ) : 0; $disable_message = isset( $form_data['settings']['form_disable_message'] ) ? evf_string_translation( $form_data['id'], 'form_disable_message', $form_data['settings']['form_disable_message'] ) : __( 'This form is disabled.', 'everest-forms' ); - if ( isset( $form_data['payments']['stripe']['enable_stripe'] ) && '1' === $form_data['payments']['stripe']['enable_stripe'] ) { + if ( ( isset( $form_data['payments']['stripe']['enable_stripe'] ) && '1' === $form_data['payments']['stripe']['enable_stripe'] ) || ( isset( $form_data['payments']['square']['enable_square'] ) && '1' === $form_data['payments']['square']['enable_square'] ) ) { $ajax_form_submission = isset( $settings['ajax_form_submission'] ) ? 1 : 0; } else { $ajax_form_submission = isset( $settings['ajax_form_submission'] ) ? $settings['ajax_form_submission'] : 0; diff --git a/readme.txt b/readme.txt index 2dacf97e5..884764e26 100644 --- a/readme.txt +++ b/readme.txt @@ -312,6 +312,7 @@ Yes you can! Join in on our [GitHub repository](https://github.com/wpeverest/eve * Feature - Enable minimum time for form submission. * Feature - Delete option in Header logo in PDF Submission. * Enhancement - Custom file name field settings. +* Dev - Square Payment. * Dev - Transaction Table. * Dev - Salesflare into Module. * Dev - ConvertKit Compatibility.