id = 'nexapay'; $this->icon = apply_filters('woocommerce_nexapay_icon',plugins_url('/assets/icon.png',__FILE__)); $this->method_title = __('nexapay','wc_nexapay_payment'); $this->method_description = __('This plugin allows you to integrate with nexapay payments','wc_nexapay_payment'); $this->title = __( "nexapay", 'wc_nexapay_payment' ); $this->description = "nexapay Payment Setting page."; $this->has_fields = false; $this->init_form_fields(); $this->init_settings(); $this->title = $this->get_option('title'); $this->url = $this->settings['nexapay_url']; $this->key_id = $this->settings['key_id']; $this->secret_key = $this->settings['secret_key']; $this->description = $this->settings['description']; $this->prod_id = $this->settings['prod_id']; $this->request_hashkey = $this->settings['request_hashkey']; $this->response_hashkey = $this->settings['response_hashkey']; $this->request_saltkey = $this->settings['request_saltkey']; $this->response_saltkey = $this->settings['response_saltkey']; $this->request_aeskey = $this->settings['request_aeskey']; $this->response_aeskey = $this->settings['response_aeskey']; add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this,'process_admin_options')); //$link = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : $woocommerce->cart->get_cart_url(); $this->thank_you_page(); //http://localhost/wordpress/checkout/ // add_action('the_content', array(&$this, 'thank_you_page')); // add_action('woocommerce_thank_you_'.$this->id, array($this,'thank_you_page')); } public function init_form_fields(){ $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'wc_nexapay_payment' ), 'type' => 'checkbox', 'label' => __( 'Enable or Disable nexapay Payments', 'wc_nexapay_payment' ), 'default' => 'yes' ), 'title' => array( 'title' => __( 'Title', 'wc_nexapay_payment' ), 'type' => 'text', 'description' => __( 'Add a new title for the nexapay Payments that customers will see when they are in the checkout page.', 'wc_payripe_payment' ), 'default' => __( 'NexaPay Your Digital Payments Partner', 'wc_nexapay_payment' ), 'desc_tip' => true, 'custom_attributes' => array('readonly' => 'readonly'), ), 'description' => array( 'title' => __( 'Description', 'wc_nexapay_payment' ), 'type' => 'textarea', 'default' =>__('Grow your business with the flawless integration of digital payments solutions!.', 'wc_nexapay_payment'), 'description'=> __('This controls the description which the user sees during checkout.', 'wc_nexapay_payment'), 'desc_tip'=> true, 'custom_attributes' => array('readonly' => 'readonly'), ), 'nexapay_url' => array( 'title' => __('Gateway Url', 'wc_nexapay_payment'), 'type' => 'text', 'default'=> __('https://prod.nexapay.in/payment/gateway/v1/initialrequest','wc_nexapay_payment'), 'description' => __('Will be provided by nexapay payment gateway', 'wc_nexapay_payment'), 'desc_tip' => true, 'custom_attributes' => array('readonly' => 'readonly'), ), 'key_id' => array( 'title' => __('Key Id', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('As provided by nexapay merchant website', 'wc_nexapay_payment'), 'desc_tip' => true ), 'secret_key' => array( 'title' => __('Secret Key', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('As provided by nexapay merchant website', 'wc_nexapay_payment'), 'desc_tip' => true ), 'prod_id' => array( 'title' => __('Product ID', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Will be provided by nexapay merchant website after production movement', 'wc_nexapay_payment'), 'desc_tip' => true ), 'request_hashkey' => array( 'title' => __('Request Hashkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Request hash key, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ), 'response_hashkey' => array( 'title' => __('Response Hashkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Response Hashkey, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ), 'request_saltkey' => array( 'title' => __('Request Saltkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Request Saltkey, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ), 'response_saltkey' => array( 'title' => __('Response Saltkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Response Saltkey, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ),'request_aeskey' => array( 'title' => __('Request AESkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Request AESkey, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ), 'response_aeskey' => array( 'title' => __('Response AESkey', 'wc_nexapay_payment'), 'type' => 'text', 'description' => __('Response AESkey, provided by nexapay merchant web site', 'wc_nexapay_payment'), 'desc_tip' => true ), ); } public function process_payment($order_id){ global $woocommerce; global $current_user; //get user details $current_user = wp_get_current_user(); $user_email = $current_user->user_email; $first_name = $current_user->user_login; $last_name = $current_user->shipping_last_name; $phone_number = $current_user->billing_phone; $country = $current_user->shipping_country; $state = $current_user->shipping_state; $city = $current_user->shipping_city; $postcode = $current_user->shipping_postcode; $address_1 = $current_user->shipping_address_1; $address_2 = $current_user->shipping_address_2; $udf2 = $first_name." ".$last_name; $udf3 = $country." ".$state." ".shipping_city." ".$address_1." ".$address_2." ".$postcode; // $udf4 = ""; // $udf5 = ""; $order= new WC_Order( $order_id ); $keyId = $this->key_id; $secretKey = $this->secret_key; $txnCurr = 'INR'; $amount = $order->get_total(); $emailId = $user_email; $username=$first_name; $mobileNumber = $phone_number; $prodId = $this->prod_id; $requestHashKey = $this->request_hashkey; $requestSaltKey = $this->request_saltkey; $requestAESKey = $this->request_aeskey; $message = $keyId.$secretKey.$txnCurr.$amount.$emailId.$mobileNumber; $signature =hash_hmac('sha256', $message, $requestHashKey); $myObj = (object)array(); $myObj->clientId= $this->key_id; $myObj->clientSecret= $this->secret_key; $myObj->txnCurr='INR'; $myObj->amount=$order->get_total(); $myObj->emailId= $user_email; $myObj->prodId= $this->prod_id; $myObj->username=$username; $myObj->mobileNumber=$phone_number; $myObj->signature=$signature; $myObj->udf1=$order_id; $myObj->udf2=$udf2; $myObj->udf3=$udf3; // $myObj->udf4=$udf4; // $myObj->udf5=$udf5; $myJSON = json_encode($myObj); $encryptJsonObj=$this-> encrypt($myJSON,$requestSaltKey,$requestAESKey); $order = wc_get_order($order_id); $order ->update_status('on-hold',__('Awaiting nexapay Payment','wc_nexapay_payment')); $param = "clientKey=".$keyId."&encrypt=".$encryptJsonObj; return array( 'result' => 'success', 'redirect' => MakeRequest."?key=".$keyId."&enc=".$encryptJsonObj."&url=".$this->url ); exit; } public function thank_you_page(){ global $woocommerce; global $wpdb, $woocommerce; $content = ""; $content .= '
'; $content .= '

nexapay Thank you

'; if(isset($_POST['secureData'])){ add_action('the_content', array(&$this, 'thank_you_page')); $responseData = $_POST['secureData']; $responesSaltKey = $this->response_saltkey; $responesAESKey = $this->response_aeskey; $decryptJsonObj = $this->decrypt($responseData,$responesSaltKey,$responesAESKey); $content .= '
'; // Convert JSON string to Array $dataArray = json_decode($decryptJsonObj, true); // $content .= "Json : ".$decryptJsonObj; // $content .="
"; // =============== response code end ============ $valid = $dataArray['status'].$dataArray['orderId'].$dataArray['transactionId'].$dataArray['bankId'].$dataArray['description']; // generate hmac sha 256 hashkey $signature= hash_hmac('sha256', $valid, $this->response_hashkey); // $content .="
"; // $content .= $signature; //================= validate signature ======================== if($dataArray['signature']==$signature){ $content .= "Status : ".$dataArray['status']; //$content .="
"; // $content .= "Client Id : ".$dataArray['clientId']; $content .="
"; $content .= "Order Id : ".$dataArray['orderId']; $content .="
"; $content .= "Bank Id : ".$dataArray['bankId']; $content .="
"; $content .= "Transaction Id : ".$dataArray['transactionId']; $content .="
"; $content .= "Amount : ".$dataArray['amount']; $content .="
"; $content .= "Email Id : ".$dataArray['emailId']; $content .="
"; $content .= "Mobile Number : ".$dataArray['mobileNumber']; // $content .="
"; //$content .= "Signature : ".$dataArray['signature']; $content .="
"; $content .= "Date : ".$dataArray['date']; $content .="
"; $content .= "Description : ".$dataArray['description']; $content .= "
"; // $content .= "Valid Transaction"; $content .= "
"; $order = new WC_Order($dataArray['udf1']); if($dataArray['status']=="200"){ $order->update_status('wc-completed',__('Payment Completed By nexapay.','wc_nexapay_payment')); }else if($dataArray['status']=="400"){ $order->update_status('wc-failed'); }else if($dataArray['status']=="402"){ $order->update_status('wc-cancelled'); } }else{ $content .= "
"; $content .= "Invalid Transaction"; $content .= "
"; } $content .= '
'; } $content .= '
'; return $content; } public function encrypt($data, $salt,$key) { if($key != NULL && $data != "" && $salt != ""){ $method = "AES-256-CBC"; /*Converting Array to bytes*/ $iv = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; $chars = array_map("chr", $iv); $IVbytes = join($chars); $salt1 = mb_convert_encoding($salt, "UTF-8"); /*Encoding to UTF-8*/ $key1 = mb_convert_encoding($key, "UTF-8"); /*Encoding to UTF-8*/ /*SecretKeyFactory Instance of PBKDF2WithHmacSHA1 Java Equivalent*/ $hash = openssl_pbkdf2($key1,$salt1,'256','65536', 'sha1'); $encrypted = openssl_encrypt($data, $method, $hash, OPENSSL_RAW_DATA, $IVbytes); return bin2hex($encrypted); }else{ return "String to encrypt, Salt and Key is required."; } } public function decrypt($data, $salt, $key) { if($key != NULL && $data != "" && $salt != ""){ $dataEncypted = hex2bin($data); $method = "AES-256-CBC"; /*Converting Array to bytes*/ $iv = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; $chars = array_map("chr", $iv); $IVbytes = join($chars); $salt1 = mb_convert_encoding($salt, "UTF-8");/*Encoding to UTF-8*/ $key1 = mb_convert_encoding($key, "UTF-8");/*Encoding to UTF-8*/ /*SecretKeyFactory Instance of PBKDF2WithHmacSHA1 Java Equivalent*/ $hash = openssl_pbkdf2($key1,$salt1,'256','65536', 'sha1'); $decrypted = openssl_decrypt($dataEncypted, $method, $hash, OPENSSL_RAW_DATA, $IVbytes); return $decrypted; }else{ return "Encrypted String to decrypt, Salt and Key is required."; } } }// class end add_filter('woocommerce_payment_gateways','add_to_nexapay_payment_gateway'); function add_to_nexapay_payment_gateway($gateways){ $gateways[] = 'WC_nexapay_Payment_Gateway'; return $gateways; } } } Queen Size – Crafted Comforts https://craftedcomforts.in Thu, 19 Oct 2023 13:39:29 +0000 en hourly 1 https://wordpress.org/?v=7.0 https://craftedcomforts.in/wp-content/uploads/2023/10/cropped-Screenshot-2023-10-19-202052-1-32x32.png Queen Size – Crafted Comforts https://craftedcomforts.in 32 32 Flair Solid Wood Queen Size Bed With Upholstered Headboard In Provincial Teak Finish https://craftedcomforts.in/product/flair-solid-wood-queen-size-bed-with-upholstered-headboard-in-provincial-teak-finish/ Thu, 19 Oct 2023 13:37:37 +0000 https://craftedcomforts.in/?post_type=product&p=1462 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric colour and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Boston Queen Size Bed With Hydraulic Storage In Sheesham Finish https://craftedcomforts.in/product/boston-queen-size-bed-with-hydraulic-storage-in-sheesham-finish/ Thu, 19 Oct 2023 13:37:37 +0000 https://craftedcomforts.in/?post_type=product&p=1463 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Lixo Queen Size Bed with Box Storage in Teak finish https://craftedcomforts.in/product/lixo-queen-size-bed-with-box-storage-in-teak-finish/ Thu, 19 Oct 2023 13:37:37 +0000 https://craftedcomforts.in/?post_type=product&p=1464 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.

Depending on your screen settings and resolution on your device there may be a slight variance in Poly-Cotton colour and wood polish of the image and actual product.

Wood grains will vary from product to product in case of solid wood furniture.

Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.

The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other types of materials used in the manufacturing of the product

]]>
Kosmo Weave Queen Size Bed with Box Storage in Vermount Finish https://craftedcomforts.in/product/kosmo-weave-queen-size-bed-with-box-storage-in-vermount-finish/ Thu, 19 Oct 2023 13:37:36 +0000 https://craftedcomforts.in/?post_type=product&p=1461 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Kosmo Cooper Queen Size Upholstered Bed With Box Storage in Natural Teak Finish https://craftedcomforts.in/product/kosmo-cooper-queen-size-upholstered-bed-with-box-storage-in-natural-teak-finish/ Thu, 19 Oct 2023 13:37:16 +0000 https://craftedcomforts.in/?post_type=product&p=1432 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Aspire Platform Queen Size Bed In Teak Finish https://craftedcomforts.in/product/aspire-platform-queen-size-bed-in-teak-finish/ Thu, 19 Oct 2023 13:37:16 +0000 https://craftedcomforts.in/?post_type=product&p=1433 Specification General
Introducing The Pure Sheesham Solid Wood Beds – For that perfect sleep, it is important to sleep on a well-built, supporting structure that will keep your spine firmly supported below the mattress. If you thought you could only buy mattress online, the sleeping world has just got a lot better for you! With Springtek, you can buy scientifically designed beds online in India. Built with 100% Sheesham wood, you can now choose a King size bed or queen size bed based on your room size and budget.

Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Magnus Queen Size Bed with Box Storage & Charger in Mist White Color https://craftedcomforts.in/product/magnus-queen-size-bed-with-box-storage-charger-in-mist-white-color/ Thu, 19 Oct 2023 13:37:15 +0000 https://craftedcomforts.in/?post_type=product&p=1428 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Uttara Solid Wood Queen Size Bed In Rustic Teak Finish https://craftedcomforts.in/product/uttara-solid-wood-queen-size-bed-in-rustic-teak-finish/ Thu, 19 Oct 2023 13:37:15 +0000 https://craftedcomforts.in/?post_type=product&p=1429 Specification General
Primary Material : Sheesham Wood

Secondary Material : MDF 12MM

Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric colour and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Kosmo Viva Queen Size Bed with Hydraulic Storage Natural Wenge finish https://craftedcomforts.in/product/kosmo-viva-queen-size-bed-with-hydraulic-storage-natural-wenge-finish/ Thu, 19 Oct 2023 13:37:15 +0000 https://craftedcomforts.in/?post_type=product&p=1430 Specification General
Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product

]]>
Josefa Queen Size Bed with Storage in Natural Teak Wood Finish https://craftedcomforts.in/product/josefa-queen-size-bed-with-storage-in-natural-teak-wood-finish/ Thu, 19 Oct 2023 13:37:15 +0000 https://craftedcomforts.in/?post_type=product&p=1431 Specification General
High Gloss Bed design with inclined HB design and dual-tone design.This bed has Storage space. Color: High Gloss Cashmere , Style: Contemporary & Modern . Bed Seating height is 35.5(CM)

Disclaimers:

Accessories shown in the image are only for representation and are not part of the product.
Depending on your screen settings and resolution on your device there may be a slight variance in fabric color and wood polish of the image and actual product.
Wood grains will vary from product to product in case of solid wood furniture.
Furniture having intricate hand-painted details are individual unique pieces and may have slight distinctions and variance between the picture and actual product.
The Primary material is the main material used to manufacture the product and in addition to the primary material there might also be other type of materials used in the manufacturing of the product
.

]]>