Changeset 2279767
- Timestamp:
- 04/09/2020 12:30:17 AM (6 years ago)
- Location:
- bkash/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bkash/trunk/bkash.php
r2277891 r2279767 168 168 $order = new WC_Order( $order_id ); 169 169 if( $order->get_payment_method() == $this->id ){ 170 170 171 $thankyou = $this->instructions; 171 172 return $thankyou; 172 173 } else { 174 173 175 return esc_html__( 'Thank you. Your order has been received.', "stb" ); 174 176 } -
bkash/trunk/index.php
r2277893 r2279767 4 4 Plugin URI: http://softtech-it.com 5 5 Description: This plugin helps users to integrate bkash , rocket and nagad payment gateway with woocommerce. bKash, rocket and rocket all of them are money transfer systems of Bangladesh by facilitating money transfer through mobile phones. This plugin is an addon for woocommerce and will provide 3 extra payment gateways through bKash, rocket and nagad in checkout page. 6 Version: 2. 16 Version: 2.2 7 7 Author: Md Toriqul Mowla Sujan 8 8 Author URI: http://facebook.com/sujan4g … … 19 19 load_plugin_textdomain( 'stb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 20 20 21 add_action("admin_menu", "softtechit_add_sms_submenu_page"); 22 23 function softtechit_add_sms_submenu_page(){ 24 add_submenu_page( 'woocommerce', 'SMS API Integration Page', 'SMS API Integration', 25 'manage_options', 'stit-sms-integration', 'stit_sms_integration_callback'); 26 } 27 28 function stit_sms_integration_callback(){ 29 30 if (!current_user_can('manage_options')) { 31 wp_die('Unauthorized user'); 32 } 33 34 if (isset($_POST['save'])) { 35 36 if (isset($_POST['sms-api-url'])) { 37 $url = $_POST["sms-api-url"]; 38 update_option('sms-api-url', $url); 39 } 40 41 if (isset($_POST['sms-api-username'])) { 42 $username = $_POST["sms-api-username"]; 43 update_option('sms-api-username', $username); 44 } 45 46 if (isset($_POST['sms-api-password'])) { 47 $password = $_POST["sms-api-password"]; 48 update_option('sms-api-password', $password); 49 } 50 51 echo '<div id="setting-error-settings_updated" class="notice notice-success settings-error is-dismissible"> 52 <p><strong>Settings saved.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'; 53 54 } 55 56 $sms_url = get_option('sms-api-url', 'http://66.45.237.70/api.php'); 57 $sms_username = get_option('sms-api-username', 'user'); 58 $sms_password = get_option('sms-api-password', 'pass'); 59 ?> 60 <div class="wrap woocommerce"> 61 <form method="post" id="mainform" action="" enctype="multipart/form-data"> 62 <?php settings_errors(); ?> 63 <h1>SMS API Integration</h1> 64 <table class="form-table"> 65 <tbody> 66 <tr valign="top"> 67 <th scope="row" class="titledesc"> 68 <label for="sms-api-url">API URL </label> 69 </th> 70 <td class="forminp"> 71 <fieldset> 72 <legend class="screen-reader-text"><span>API URL</span></legend> 73 <input class="input-text regular-input " type="url" name="sms-api-url" id="sms-api-url" style="" value="<?php echo $sms_url; ?>" placeholder=""> 74 <p class="description">The API link / url you have got from your sms gateway provider. It can be like this ( http://66.45.237.70/api.php )</p> 75 </fieldset> 76 </td> 77 </tr> 78 79 <tr valign="top"> 80 <th scope="row" class="titledesc"> 81 <label for="sms-api-username">Username </label> 82 </th> 83 <td class="forminp"> 84 <fieldset> 85 <legend class="screen-reader-text"><span>Username</span></legend> 86 <input class="input-text regular-input " type="text" name="sms-api-username" id="sms-api-username" style="" value="<?php echo $sms_username; ?>" placeholder=""> 87 <p class="description">The Username of your API</p> 88 </fieldset> 89 </td> 90 </tr> 91 92 <tr valign="top"> 93 <th scope="row" class="titledesc"> 94 <label for="sms-api-password">Password </label> 95 </th> 96 <td class="forminp"> 97 <fieldset> 98 <legend class="screen-reader-text"><span>Password</span></legend> 99 <input class="input-text regular-input " type="password" name="sms-api-password" id="sms-api-password" style="" value="<?php echo $sms_password; ?>" placeholder=""> 100 <p class="description">The Password of your API</p> 101 </fieldset> 102 </td> 103 </tr> 104 105 106 </tbody> 107 </table> 108 109 <p class="submit"> 110 <?php wp_nonce_field( 'sms_nonce_field' ); ?> 111 <button name="save" class="button-primary woocommerce-save-button" type="submit" value="Save changes">Save changes</button> 112 113 </p> 114 </form> 115 </div> 116 <?php 117 } 118 119 add_filter("woocommerce_thankyou_order_received_text", "softtechit_send_sms_when_order_received"); 120 121 function softtechit_send_sms_when_order_received(){ 122 123 $order_id = get_query_var('order-received'); 124 $order = new WC_Order( $order_id ); 125 126 $sms_url = get_option('sms-api-url', 'http://66.45.237.70/api.php'); 127 $sms_username = get_option('sms-api-username', 'user'); 128 $sms_password = get_option('sms-api-password', 'pass'); 129 130 $url = $sms_url; 131 $username = $sms_username; 132 $password = $sms_password; 133 $phone = "88" . $order->get_billing_phone(); 134 $message = "Hello " . $order->get_billing_first_name() . " " . $order->get_billing_last_name() . "," ."\n\nthank you for your order \n#" . $order_id . ". View the latest status of your order here\n" . site_url() ."/my-account/orders/"; 135 $data = array( 136 "username" => $username, 137 "password" => $password, 138 "number" => $phone, 139 "message" => $message, 140 ); 141 142 $ch = curl_init(); 143 curl_setopt($ch, CURLOPT_URL, $url ); 144 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data) ); 145 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); 146 $smsresult = curl_exec($ch); 147 } 148 149 150 151 152 153 154 21 155 22 156 add_action( 'wp_enqueue_scripts', 'softtech_payment_method_script' ); -
bkash/trunk/readme.txt
r2277891 r2279767 4 4 Requires at least: 4.5.0 5 5 Tested up to: 5.4 6 Stable tag: 2. 16 Stable tag: 2.2 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 13 13 == Description == 14 14 15 This is a cool plugin to integrate bKash , Rocket and Nagad payment gateway in any woocommerce based website. It is lightweight and very easy to use.15 This is a cool plugin to integrate bKash , Rocket and Nagad payment gateway and also SMS api in any woocommerce based website. It is lightweight and very easy to use. 16 16 17 17 Please note: 18 18 - This is a woocommerce based plugin so woocommerce plugin must be activated. 19 19 - You must have a bKash or Rocket or Nagad account to get payments. 20 - you must have bulksmsbd.com account to integrate sms api 20 21 21 22 = Using the Plugin = … … 30 31 31 32 * Now you will see few default setup but you need to fill up bKash/Rocket/Nagad account number under <strong>bKash Number/Rocket Number/Nagad Number</strong> field, also you might adjust other fileds too. 33 34 * If you want to send sms to users automatically when they order any product, 35 then at first create an account to bulksmsbd.com and recharge some amount to buy sms credit. you will get an option named API in the bulksmsbd dashboard, go to the API page and you will get the API url in that page. after that please login to your wordpress dashboard and then go to 36 WooCommerce > SMS API Integration, then insert the api url, your bulksmsbd username and password and save 32 37 33 38 * That's it. You are ready to go! … … 63 68 == Changelog == 64 69 70 = 2.2 = 71 * Added - sms api integrated 72 65 73 = 2.1 = 66 74 * Fix - made the bkash , rocket and nagad charges to round number
Note: See TracChangeset
for help on using the changeset viewer.