diff --git a/atoms.scss b/atoms.scss index d5a0b6c4..73463eba 100644 --- a/atoms.scss +++ b/atoms.scss @@ -13,13 +13,17 @@ color: currentColor; font: 400 18px var(--nfd-ecommerce-font-primary); } + a { + color: var(--nfd-ecommerce-accent-primary); + text-decoration: none; + } .nfd-ecommerce-loader-mini { width: 1em; height: 1em; margin: 0; } .nfd-ecommerce-loader-inverse { - background: linear-gradient(to right, #f1f5f7 5%, rgba(0,0,0,0) 32%); + background: linear-gradient(to right, #f1f5f7 5%, rgba(0, 0, 0, 0) 32%); &:before { background: #f1f5f7; } diff --git a/build/index.asset.php b/build/index.asset.php index db1b5b98..2d4bbb2e 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '8b69f94ca7bf0d2ddc2f'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c737810d340adc0b0f21'); diff --git a/includes/Data/Brands.php b/includes/Data/Brands.php new file mode 100644 index 00000000..8b9b2073 --- /dev/null +++ b/includes/Data/Brands.php @@ -0,0 +1,62 @@ + array( + 'brand' => 'crazy-domains', + 'name' => 'CrazyDomains', + 'url' => 'https://crazydomains.com', + 'hireExpertsInfo' => 'admin.php?page=crazy-domains#/marketplace/services/blue-sky', + 'adminPage' => 'admin.php?page=crazy-domains', + 'setup' => array( + 'payment' => array('Paypal'), + 'shipping' => array('Shippo'), + ), + 'defaultContact' => array( + 'woocommerce_default_country' => 'AU:NSW', + 'woocommerce_currency' => 'AUD', + ), + ), + 'bluehost' => array( + 'brand' => 'bluehost', + 'name' => 'Bluehost', + 'url' => 'https://bluehost.com', + 'hireExpertsInfo' => 'admin.php?page=bluehost#/marketplace/services/blue-sky', + 'adminPage' => 'admin.php?page=bluehost', + 'setup' => array( + 'payment' => array('Paypal'), + 'shipping' => array('Shippo'), + ), + 'defaultContact' => array( + 'woocommerce_default_country' => 'US:AZ', + 'woocommerce_currency' => 'USD', + ), + ), + 'bluehost-india' => array( + 'brand' => 'bluehost-india', + 'name' => 'Bluehost', + 'url' => 'https://bluehost.in', + 'hireExpertsInfo' => 'https://www.bluehost.in/solutions/full-service', + 'adminPage' => 'admin.php?page=bluehost', + 'setup' => array( + 'payment' => array('Razorpay'), + 'shipping' => array(), + ), + 'defaultContact' => array( + 'woocommerce_default_country' => 'IN:AP', + 'woocommerce_currency' => 'INR', + ), + ), + ); + } +} diff --git a/includes/Data/Plugins.php b/includes/Data/Plugins.php index 2ccab1dc..fdfd8b8b 100644 --- a/includes/Data/Plugins.php +++ b/includes/Data/Plugins.php @@ -17,6 +17,7 @@ public static function get_slug_map( $plugin ) { 'yith_shippo_shipping_for_woocommerce' => array( 'https://hiive.cloud/workers/plugin-downloads/yith-shippo-shippings-for-woocommerce', 'yith-shippo-shippings-for-woocommerce-extended/init.php' ), 'yith_paypal_payments' => array( 'https://hiive.cloud/workers/plugin-downloads/yith-paypal-payments-for-woocommerce', 'yith-paypal-payments-for-woocommerce-extended/init.php' ), 'woocommerce' => array( 'ignore', 'woocommerce/woocommerce.php' ), + 'woo_razorpay' => array( 'ignore', 'woo-razorpay/woo-razorpay.php' ), ); if ( in_array( $plugin, array_keys( $map ) ) ) { $plugin = $map[ $plugin ]; diff --git a/includes/ECommerce.php b/includes/ECommerce.php index b7293fba..ffca6440 100644 --- a/includes/ECommerce.php +++ b/includes/ECommerce.php @@ -21,6 +21,7 @@ class ECommerce { protected $options = array( 'nfd-ecommerce-captive-flow-paypal', 'nfd-ecommerce-captive-flow-shippo', + 'nfd-ecommerce-captive-flow-razorpay', 'nfd-ecommerce-onboarding-check', 'nfd-ecommerce-counter', 'woocommerce_store_address', diff --git a/includes/Partials/CaptiveFlow.php b/includes/Partials/CaptiveFlow.php index 7ec22795..01ca452d 100644 --- a/includes/Partials/CaptiveFlow.php +++ b/includes/Partials/CaptiveFlow.php @@ -5,10 +5,57 @@ class CaptiveFlow { + static $PAYPAL_CAPTIVE_FLOW = 'nfd-ecommerce-captive-flow-paypal'; + static $SHIPPO_CAPTIVE_FLOW = 'nfd-ecommerce-captive-flow-shippo'; + static $RAZORPAY_CAPTIVE_FLOW = 'nfd-ecommerce-captive-flow-razorpay'; + public static function init() { add_action( 'admin_menu', array( __CLASS__, 'register_page' ) ); - add_action( 'load-admin_page_' . 'nfd-ecommerce-captive-flow-paypal', array( __CLASS__, 'enqueue_styles' ), 100 ); - add_action( 'load-admin_page_' . 'nfd-ecommerce-captive-flow-shippo', array( __CLASS__, 'enqueue_styles' ), 100 ); + add_action( 'rest_api_init', array( __CLASS__, 'register_options' ) ); + add_action( 'load-admin_page_' . self::$PAYPAL_CAPTIVE_FLOW, array( __CLASS__, 'enqueue_styles' ), 100 ); + add_action( 'load-admin_page_' . self::$SHIPPO_CAPTIVE_FLOW, array( __CLASS__, 'enqueue_styles' ), 100 ); + } + + public static function register_options() { + \register_setting( + 'general', + 'woocommerce_razorpay_settings', + array( + 'show_in_rest' => array( + 'schema' => array( + 'type' => 'object', + 'properties' => array( + 'enabled' => array( + 'type' => 'string', + ), + 'title' => array( + 'type' => 'string', + ), + 'description' => array( + 'type' => 'string', + ), + 'key_id' => array( + 'type' => 'string', + ), + 'key_secret' => array( + 'type' => 'string', + ), + 'payment_action' => array( + 'type' => 'string', + ), + 'order_success_message' => array( + 'type' => 'string', + ), + 'enable_1cc_debug_mode' => array( + 'type' => 'string', + ), + ), + ), + ), + 'type' => 'object', + 'description' => __( 'NFD eCommerce RazorPay Options', 'wp-module-ecommerce' ), + ) + ); } public static function enqueue_styles() { @@ -27,7 +74,7 @@ public static function register_page() { null, null, Permissions::ADMIN, - 'nfd-ecommerce-captive-flow-paypal', + self::$PAYPAL_CAPTIVE_FLOW, array( __CLASS__, 'render_paypal' ), 100 ); @@ -36,7 +83,7 @@ public static function register_page() { null, null, Permissions::ADMIN, - 'nfd-ecommerce-captive-flow-shippo', + self::$SHIPPO_CAPTIVE_FLOW, array( __CLASS__, 'render_shippo' ), 100 ); @@ -45,7 +92,7 @@ public static function register_page() { public static function render_paypal() { echo PHP_EOL; echo '