integrate-razorpay-contact-form-7
Last commit date
assets
1 week ago
includes
1 week ago
razorpay-php
4 years ago
integrate-razorpay-for-contact-form-7.php
1 week ago
readme.txt
1 week ago
integrate-razorpay-for-contact-form-7.php
83 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Plugin Name: Integrate Razorpay for Contact Form 7 |
| 5 | * Description: This plugin seamlessly integrates Razorpay with Contact Form 7. |
| 6 | * Version: 2.0.6 |
| 7 | * Requires at least: 5.6 |
| 8 | * Requires PHP: 7.2 |
| 9 | * Author: Codolin Technologies |
| 10 | * Author URI: https://www.codolin.com?utm_source=wordpress&utm_medium=plugin&utm_campaign=integrate-razorpay-cf7&utm_id=integrate-razorpay-cf7 |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | define('CF7RZP_VERSION_NUM', '2.0.6'); |
| 15 | define('CF7RZP_DIR_NAME', 'integrate-razorpay-contact-form-7'); |
| 16 | define('CF7RZP_DIR_URL', plugin_dir_url( __FILE__ )); |
| 17 | //define('CF7RZP_DEFAULT_CMP_NAME', 'Acme Corp'); |
| 18 | //define('CF7RZP_DEFAULT_CMP_LOGO', 'https://cdn.razorpay.com/logos/FFATTsJeURNMxx_medium.png'); |
| 19 | |
| 20 | |
| 21 | // plugin functions |
| 22 | register_activation_hook( __FILE__, "cf7rzp_activate" ); |
| 23 | register_deactivation_hook( __FILE__, "cf7rzp_deactivate" ); |
| 24 | register_uninstall_hook( __FILE__, "cf7rzp_uninstall" ); |
| 25 | |
| 26 | function cf7rzp_activate() { |
| 27 | |
| 28 | // default options |
| 29 | $cf7rzp_options = array( |
| 30 | 'mode' => '1', |
| 31 | 'rzp_key_id' => '', |
| 32 | 'rzp_key_secret' => '', |
| 33 | 'rzp_cmp_name' => '', |
| 34 | /*'rzp_cmp_logo' => '',*/ |
| 35 | 'return_url' => '', |
| 36 | 'cancel_url' => '' |
| 37 | ); |
| 38 | |
| 39 | add_option("cf7rzp_options", $cf7rzp_options); |
| 40 | |
| 41 | } |
| 42 | |
| 43 | function cf7rzp_deactivate() { |
| 44 | } |
| 45 | |
| 46 | function cf7rzp_uninstall() { |
| 47 | } |
| 48 | |
| 49 | // check to make sure contact form 7 is installed and active |
| 50 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 51 | if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
| 52 | |
| 53 | // public includes |
| 54 | include_once('includes/enqueue.php'); |
| 55 | |
| 56 | // admin includes |
| 57 | if (is_admin()) { |
| 58 | include_once('includes/admin/rzp_tab.php'); |
| 59 | include_once('includes/admin/rzp_menu_links.php'); |
| 60 | include_once('includes/admin/rzp_settings.php'); |
| 61 | include_once('includes/admin/enqueue.php'); |
| 62 | include_once('includes/admin/functions.php'); |
| 63 | } |
| 64 | |
| 65 | // include payments functionality |
| 66 | include_once('includes/payments/main.inc.php'); |
| 67 | |
| 68 | } else { |
| 69 | |
| 70 | // give warning if contact form 7 is not active |
| 71 | function cf7rzp_my_admin_notice() { |
| 72 | ?> |
| 73 | <div class="error"> |
| 74 | <p><?php _e( '<b>Integrate Razorpay for Contact Form 7:</b> Contact Form 7 is not installed and / or active! Please install <a target="_blank" href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>.', 'cf7rzp' ); ?></p> |
| 75 | </div> |
| 76 | <?php |
| 77 | } |
| 78 | add_action( 'admin_notices', 'cf7rzp_my_admin_notice' ); |
| 79 | |
| 80 | } |
| 81 | |
| 82 | ?> |
| 83 |