Changeset 2466373
- Timestamp:
- 02/01/2021 12:01:17 PM (5 years ago)
- Location:
- decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce
- Files:
-
- 84 added
- 7 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/LICENSE.txt (added)
-
tags/1.0.1/README.txt (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/core.php (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/admin/itls-wp-prerender-class.php (added)
-
tags/1.0.1/admin/itls-wp-render-class.php (added)
-
tags/1.0.1/admin/options.php (added)
-
tags/1.0.1/admin/scripts.php (added)
-
tags/1.0.1/admin/tmpl-options.php (added)
-
tags/1.0.1/admin/tmpl-reset.php (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/index.php (added)
-
tags/1.0.1/assets/css/style-gw.css (added)
-
tags/1.0.1/assets/images (added)
-
tags/1.0.1/assets/images/btc-logo-2.png (added)
-
tags/1.0.1/assets/images/btc-logo-3.png (added)
-
tags/1.0.1/assets/images/btc-logo.png (added)
-
tags/1.0.1/assets/images/index.php (added)
-
tags/1.0.1/assets/images/logo-gw.png (added)
-
tags/1.0.1/assets/images/logox.png (added)
-
tags/1.0.1/assets/index.php (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/index.php (added)
-
tags/1.0.1/cryptodec-payment-gateway.php (added)
-
tags/1.0.1/inc (added)
-
tags/1.0.1/inc/cron.php (added)
-
tags/1.0.1/inc/index.php (added)
-
tags/1.0.1/inc/itls-btc-class.php (added)
-
tags/1.0.1/inc/itls-btc-wp-class.php (added)
-
tags/1.0.1/inc/itls-crypto-dec-payment-gateway-class.php (added)
-
tags/1.0.1/inc/model-setup.php (added)
-
tags/1.0.1/inc/model.php (added)
-
tags/1.0.1/inc/plugin.php (added)
-
tags/1.0.1/inc/sochain-v1-class.php (added)
-
tags/1.0.1/lib (added)
-
tags/1.0.1/lib/index.php (added)
-
tags/1.0.1/lib/itls-wp-helper-class.php (added)
-
tags/1.0.1/lib/itls-wp-helper.php (added)
-
tags/1.0.2 (added)
-
tags/1.0.2/LICENSE.txt (added)
-
tags/1.0.2/README.txt (added)
-
tags/1.0.2/admin (added)
-
tags/1.0.2/admin/core.php (added)
-
tags/1.0.2/admin/index.php (added)
-
tags/1.0.2/admin/itls-wp-prerender-class.php (added)
-
tags/1.0.2/admin/itls-wp-render-class.php (added)
-
tags/1.0.2/admin/options.php (added)
-
tags/1.0.2/admin/scripts.php (added)
-
tags/1.0.2/admin/tmpl-options.php (added)
-
tags/1.0.2/admin/tmpl-reset.php (added)
-
tags/1.0.2/assets (added)
-
tags/1.0.2/assets/css (added)
-
tags/1.0.2/assets/css/admin.css (added)
-
tags/1.0.2/assets/css/index.php (added)
-
tags/1.0.2/assets/css/style-gw.css (added)
-
tags/1.0.2/assets/images (added)
-
tags/1.0.2/assets/images/btc-logo-2.png (added)
-
tags/1.0.2/assets/images/btc-logo-3.png (added)
-
tags/1.0.2/assets/images/btc-logo.png (added)
-
tags/1.0.2/assets/images/index.php (added)
-
tags/1.0.2/assets/images/logo-gw.png (added)
-
tags/1.0.2/assets/images/logox.png (added)
-
tags/1.0.2/assets/index.php (added)
-
tags/1.0.2/assets/js (added)
-
tags/1.0.2/assets/js/index.php (added)
-
tags/1.0.2/cryptodec-payment-gateway.php (added)
-
tags/1.0.2/inc (added)
-
tags/1.0.2/inc/cron.php (added)
-
tags/1.0.2/inc/index.php (added)
-
tags/1.0.2/inc/itls-btc-class.php (added)
-
tags/1.0.2/inc/itls-btc-wp-class.php (added)
-
tags/1.0.2/inc/itls-crypto-dec-payment-gateway-class.php (added)
-
tags/1.0.2/inc/model-setup.php (added)
-
tags/1.0.2/inc/model.php (added)
-
tags/1.0.2/inc/plugin.php (added)
-
tags/1.0.2/inc/sochain-v1-class.php (added)
-
tags/1.0.2/lib (added)
-
tags/1.0.2/lib/index.php (added)
-
tags/1.0.2/lib/itls-wp-helper-class.php (added)
-
tags/1.0.2/lib/itls-wp-helper.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/options.php (modified) (1 diff)
-
trunk/cryptodec-payment-gateway.php (modified) (3 diffs)
-
trunk/inc/itls-btc-wp-class.php (modified) (1 diff)
-
trunk/inc/itls-crypto-dec-payment-gateway-class.php (modified) (1 diff)
-
trunk/inc/plugin.php (modified) (8 diffs)
-
trunk/lib/itls-wp-helper-class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/README.txt
r2465371 r2466373 5 5 Requires at least: 4.6 6 6 Tested up to: 5.6 7 Stable tag: 4.37 Stable tag: 1.0.2 8 8 Requires PHP: 6.0 9 9 License: GPLv2 or later … … 26 26 27 27 * Transaction ID request form on Checkout 28 * Force Customers to provide Transaction ID (optional) 28 29 * Assign single wallet to a customer to simplify recurring payments 29 30 * You control your wallets, you control your keys … … 65 66 == Changelog == 66 67 68 = 1.0.2 Jan 28, 2021 = 69 * add extra options: Force Transaction ID 70 * Check for double Transaction ID 71 67 72 = 1.0.1 Jan 28, 2021 = 68 73 * Initial release -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/admin/options.php
r2465865 r2466373 7 7 $itls_wc_pay_gw_x1x_options = array ( 8 8 9 'tab-popup' => array ( 9 'tab-general' => array ( 10 'name' => 'CryptoDEC Settings', 11 'options' => array ( 12 13 14 'itls_txid_force' => array( 15 16 'name' => 'itls_txid_force', 17 'type' => 'check', 18 'print' => __('Force Transaction ID'), 19 'help' => 'Switch (On/Off) if you want to force customers to enter Transactio ID. Default: Off.', 20 'data' => 'bool', 21 'value' => '0', 22 23 ), 24 25 26 27 28 ) 29 ), 30 31 'tab-btc' => array ( 10 32 'name' => 'Bitcoin BTC', 11 33 'options' => array ( -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/cryptodec-payment-gateway.php
r2465341 r2466373 6 6 * Author: ITLS 7 7 * Author URI: https://ampae.com 8 * Version: 1.0. 18 * Version: 1.0.2 9 9 * Text Domain: decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce 10 10 * … … 46 46 'full_name' => 'CryptoDecPaymentGateway', 47 47 'full_author' => 'ITLS', 48 'version' => '1.0. 1',48 'version' => '1.0.2', 49 49 50 50 'settings_version' => '3', … … 139 139 function ITLS_cryptodec_uninstall() 140 140 { 141 include_once(dirname(__FILE__). '/inc/model-setup.php'); 141 142 ITLS_cd_drop_payment_table(); 142 143 } -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/inc/itls-btc-wp-class.php
r2465865 r2466373 44 44 public function get_qr_code($walletAddress, $cryptoTotal) 45 45 { 46 $writeDir = plugin_dir_path(__FILE__) . '../tmp/';47 $readDir = plugin_dir_url(__FILE__) . '../tmp/';46 //$writeDir = plugin_dir_path(__FILE__) . '../tmp/'; 47 //$readDir = plugin_dir_url(__FILE__) . '../tmp/'; 48 48 49 49 $qrData = $walletAddress; -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/inc/itls-crypto-dec-payment-gateway-class.php
r2466184 r2466373 38 38 <?php $this->generate_settings_html(); ?> 39 39 </table> 40 <a href=<?php echo get_site_url() . '/wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page#itls-cryptodec-gw-adm-tab- popup'?>>Crypto DEC Plugin Settings</a>40 <a href=<?php echo get_site_url() . '/wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page#itls-cryptodec-gw-adm-tab-general'?>>Crypto DEC Plugin Settings</a> 41 41 </div> 42 42 <?php -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/inc/plugin.php
r2465341 r2466373 3 3 function cryptodec_checkout_process() 4 4 { 5 global $itls_wc_pay_gw_x1x_data; 5 6 6 7 if ($_POST['payment_method'] != 'cryptodec_gateway') { … … 8 9 } 9 10 11 //$txid_force = true; 12 13 $oName = $itls_wc_pay_gw_x1x_data['options_name']; 14 $options = get_option($oName); 15 $txid_force = $options['itls_txid_force']; 10 16 11 17 $cryptodec_transaction_id = sanitize_text_field($_POST['cryptodec_transaction_id']); 12 /* 13 if( !isset($cryptodec_transaction_id) || empty($cryptodec_transaction_id) ) 14 wc_add_notice( esc_html__( 'Please enter your transaction ID', 'decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce' ), 'error' ); 15 16 */ 18 19 if ($txid_force) { 20 if (!isset($cryptodec_transaction_id) || empty($cryptodec_transaction_id)) { 21 wc_add_notice(esc_html__('Please enter your transaction ID', 'decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce'), 'error'); 22 } else { 23 if (ITLS_cd_is_hash_count($cryptodec_transaction_id) > 0) { 24 wc_add_notice(esc_html__('This Transaction ID has been already processed, please provide another Transaction ID', 'decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce'), 'error'); 25 } 26 } 27 } 17 28 18 29 $wallet = sanitize_text_field($_POST['cryptodec_best_btc_wallet']); … … 26 37 wc_add_notice(esc_html__('Only HEX HASH is acceptable', 'decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce'), 'error'); 27 38 } 28 29 39 } 30 40 31 41 add_action('woocommerce_checkout_process', 'cryptodec_checkout_process'); 32 42 33 function action_checkout_order_processed( $order_id, $posted_data, $order ) { 34 //TODO: check if wallet is ours! 35 // check if amount is adequate 36 // before adding to db !!! 37 // fix coin !!! 38 $hash_by = 'NOPE'; 39 $coin = 'BTC'; 40 $status = 'PENDING'; 41 42 $wallet = get_post_meta($order_id, '_cryptodec_best_btc_wallet', true); 43 $total = get_post_meta($order_id, '_cryptodec_total', true); 44 $hash = get_post_meta($order_id, '_cryptodec_transaction_id', true); 45 46 if ( ITLS_cd_is_hash_count($hash) > 0 ) { 47 $hash = ''; 48 } 49 50 if (strlen($hash) > 15) { 51 $hash_by = 'USER'; 52 } 53 ITLS_cd_put_payment($wallet, $coin, $order_id, $total, $hash, $hash_by, $status); 43 function action_checkout_order_processed($order_id, $posted_data, $order) 44 { 45 //TODO: check if wallet is ours! 46 // check if amount is adequate 47 // before adding to db !!! 48 // fix coin !!! 49 $hash_by = 'NOPE'; 50 $coin = 'BTC'; 51 $status = 'PENDING'; 52 53 $wallet = get_post_meta($order_id, '_cryptodec_best_btc_wallet', true); 54 $total = get_post_meta($order_id, '_cryptodec_total', true); 55 $hash = get_post_meta($order_id, '_cryptodec_transaction_id', true); 56 57 if (ITLS_cd_is_hash_count($hash) > 0) { 58 $hash = ''; 59 } 60 61 if (strlen($hash) > 15) { 62 $hash_by = 'USER'; 63 } 64 ITLS_cd_put_payment($wallet, $coin, $order_id, $total, $hash, $hash_by, $status); 54 65 } 55 66 add_action('woocommerce_checkout_order_processed', 'action_checkout_order_processed', 10, 3); … … 96 107 $my_wallet = get_post_meta($order->id, '_cryptodec_best_btc_wallet', true); 97 108 $my_total = get_post_meta($order->id, '_cryptodec_total', true); 98 $transaction = get_post_meta($order->id, '_cryptodec_transaction_id', true); 99 ?> 109 $transaction = get_post_meta($order->id, '_cryptodec_transaction_id', true); ?> 100 110 <div class="form-field form-field-wide"> 101 111 <img src='<?php echo plugin_dir_url(__FILE__) . '../assets/images/logo-gw.png'; ?>' alt="CryptoDec"> … … 133 143 $qrCode = $itls_btc_wp->get_qr_code($wallet, 0); 134 144 135 $order = wc_get_order( $order_id);145 $order = wc_get_order($order_id); 136 146 $status = $order->get_status(); 137 147 … … 157 167 <?php 158 168 if ($status!=='completed') { 159 ?>169 ?> 160 170 <th>QR Code</th> 161 171 <td><img height="120" width="120" style="display: block; max-width:120px; max-height:120px; width: auto; height: auto;" src=<?php echo $qrCode; ?> /></td> 162 172 <?php 163 } else {164 ?>173 } else { 174 ?> 165 175 166 176 <th>Date Paid</th> … … 168 178 169 179 <?php 170 } 171 ?> 180 } ?> 172 181 </tr> 173 182 </tbody> … … 175 184 <?php 176 185 } 186 187 add_action('show_user_profile', 'cryptodec_user_profile_field'); 188 add_action('edit_user_profile', 'cryptodec_user_profile_field'); 189 190 function cryptodec_user_profile_field($user) 191 { 192 $tmp = ''; 193 if (!current_user_can('edit_user', $user_id)) { 194 $tmp = ' disabled'; 195 } ?> 196 <h3>CryptoDEC</h3> 197 <table class="form-table"> 198 <tr> 199 <th><label for="best_btc_wallet">BTC Wallet Assigned:</label></th> 200 <td> 201 <input name="best_btc_wallet" id="best_btc_wallet" value="<?php echo esc_attr(get_the_author_meta('best_btc_wallet', $user->ID)); ?>" class="regular-text" type="text" <?php echo $tmp; ?>> 202 </td> 203 </tr> 204 </table> 205 <?php 206 } 207 208 add_action('edit_user_profile_update', 'save_cryptodec_user_profile_field'); 209 function save_cryptodec_user_profile_field($user_id) 210 { 211 if (current_user_can('edit_user', $user_id)) { 212 update_user_meta(absint($user_id), 'best_btc_wallet', wp_kses_post($_POST['best_btc_wallet'])); 213 } else { 214 return false; 215 } 216 } -
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/lib/itls-wp-helper-class.php
r2465341 r2466373 44 44 45 45 46 46 47 /** 47 48 * Pull the feed
Note: See TracChangeset
for help on using the changeset viewer.