Changeset 2575892
- Timestamp:
- 08/01/2021 03:11:40 AM (5 years ago)
- Location:
- rimplenet/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (3 diffs)
-
includes/class-emails.php (modified) (1 diff)
-
includes/class-investments.php (modified) (7 diffs)
-
includes/class-package-plans-and-rules.php (modified) (2 diffs)
-
includes/layouts/rimplenet-investment-form.php (modified) (5 diffs)
-
rimplenet.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rimplenet/trunk/README.txt
r2574985 r2575892 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.8 7 Stable tag: 1.1.1 47 Stable tag: 1.1.16 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 81 81 == Changelog == 82 82 83 = 1.1.16 = 84 * Investment Packages Capital can now be refunded to users on Investment Contract Completion 83 85 = 1.1.15 = 84 86 * Investment Packages now works async … … 118 120 119 121 == Upgrade Notice == 122 = 1.1.16 = 123 * Investment Packages Capital can now be refunded to users on Investment Contract Completion 120 124 = 1.1.15 = 121 125 * Investment Packages now works async -
rimplenet/trunk/includes/class-emails.php
r2574985 r2575892 115 115 <p style='background:#2d2f33; color:white; padding:25px; text-align:center;'> 116 116 This email was sent from <a href='$blogurl' style='color: #d28787;'> $blogname_uppercase </a> 117 <small>Powered by <em><a href='https://rimplenet.com'>Rimplenet</a></em></small> 117 118 </p> 118 119 <div/>"; -
rimplenet/trunk/includes/class-investments.php
r2469226 r2575892 7 7 add_shortcode('rimplenet-investment-form', array($this, 'RimplenetInvestmentForm')); 8 8 add_filter('rimplenet_constant_var', array($this, 'apply_rimplenet_constant_var_on_package_investment_rules'), 1, 3); 9 add_action('wp',array($this,'return_investment_capital')); 9 10 11 } 12 13 function return_investment_capital(){ 14 15 $post_per_page = rand(1,500); 16 $txn_loop = new WP_Query( 17 array( 18 'post_type' => 'rimplenettransaction', 19 'post_status' => 'publish', 20 'order' => 'ASC', 21 'posts_per_page'=>$post_per_page , 22 'meta_query' => array( 23 'relation' => 'AND', 24 array( 25 'key' => 'time_for_invested_amount_to_be_returned', 26 'compare' => 'EXISTS', 27 ), 28 array( 29 'key' => 'invesment_returned', 30 'compare' => 'NOT EXISTS', 31 ), 32 ), 33 'tax_query' => array( 34 array( 35 'taxonomy' => 'rimplenettransaction_type', 36 'field' => 'name', 37 'terms' => 'INVESTMENTS', 38 ), 39 ), 40 'fields' => 'ids', // Only get post IDs 41 ) 42 ); 43 44 $investments_id_array = $txn_loop->posts; 45 wp_reset_postdata(); 46 47 foreach($investments_id_array as $key=>$inv_id){ 48 $time_for_refund = get_post_meta($inv_id,"time_for_invested_amount_to_be_returned",true); 49 $current_time = time(); 50 51 if($current_time>$time_for_refund){ 52 53 $wallet_obj = new Rimplenet_Wallets(); 54 $all_wallets = $wallet_obj->getWallets(); 55 $txn_owner_user_id = get_post_field('post_author',$inv_id); 56 $amount_to_returned = get_post_field( "amount", $inv_id); 57 $investment_wallet = get_post_field("currency", $inv_id); 58 $note = "Capital Returns for Investment - #$inv_id"; 59 $tags["txn_ref"] = "invested_amount_returned_on_investment_".$inv_id; 60 61 $funds_id_capital_returned = $wallet_obj->add_user_mature_funds_to_wallet($txn_owner_user_id, $amount_to_returned, $investment_wallet,$note,$tags); 62 63 update_post_meta($inv_id, "invesment_returned","yes"); 64 add_post_meta($inv_id, "time_invesment_returned",time()); 65 add_post_meta($inv_id, "invesment_returned_txn_id",$funds_id_capital_returned); 66 } 67 } 10 68 } 11 69 … … 13 71 14 72 15 $wallet_obj = new Rimplenet_Wallets();16 $user_wdr_bal = $wallet_obj->get_withdrawable_wallet_bal($user_id, $wallet_id);17 $user_non_wdr_bal = $wallet_obj->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);18 19 $walllets = $wallet_obj->getWallets();73 $wallet_obj = new Rimplenet_Wallets(); 74 $user_wdr_bal = $wallet_obj->get_withdrawable_wallet_bal($user_id, $wallet_id); 75 $user_non_wdr_bal = $wallet_obj->get_nonwithdrawable_wallet_bal($user_id, $wallet_id); 76 77 $walllets = $wallet_obj->getWallets(); 20 78 $dec = $walllets[$wallet_id]['decimal']; 21 79 $symbol = $walllets[$wallet_id]['symbol']; … … 23 81 24 82 $balance = $symbol.number_format($balance,$dec); 25 83 26 84 if (empty($amount_to_invest) OR empty($wallet_id) OR empty($user_id)) { 27 $investment_info = 'One or more compulsory field is empty';28 }29 elseif ($amount_to_invest>$user_wdr_bal) {30 $investment_info = 'Amount to Invest - <strong>['.getRimplenetWalletFormattedAmount($amount_to_invest,$wallet_id).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.getRimplenetWalletFormattedAmount($user_wdr_bal,$wallet_id).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. getRimplenetWalletFormattedAmount($user_non_wdr_bal,$wallet_id).'] )</strong> cannot be invested until maturity';31 }85 $investment_info = 'One or more compulsory field is empty'; 86 } 87 elseif ($amount_to_invest>$user_wdr_bal) { 88 $investment_info = 'Amount to Invest - <strong>['.getRimplenetWalletFormattedAmount($amount_to_invest,$wallet_id).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.getRimplenetWalletFormattedAmount($user_wdr_bal,$wallet_id).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. getRimplenetWalletFormattedAmount($user_non_wdr_bal,$wallet_id).'] )</strong> cannot be invested until maturity'; 89 } 32 90 33 34 else{35 36 91 92 else{ 93 94 37 95 38 96 $amount_to_invest = $amount_to_invest * -1; … … 59 117 60 118 } 61 }119 } 62 120 wp_reset_postdata(); 63 121 return $investment_info; … … 67 125 68 126 public function RimplenetInvestmentForm($atts) { 69 127 70 128 71 ob_start();129 ob_start(); 72 130 73 include plugin_dir_path( __FILE__ ) . 'layouts/rimplenet-investment-form.php';74 75 $output = ob_get_clean();131 include plugin_dir_path( __FILE__ ) . 'layouts/rimplenet-investment-form.php'; 132 133 $output = ob_get_clean(); 76 134 77 return $output;78 135 return $output; 136 79 137 } 80 138 … … 102 160 103 161 if (is_numeric($investment_amount)) { 104 //Extract the constant match using the preg_match_all function to $inv_amount_percent_matches.162 //Extract the constant match using the preg_match_all function to $inv_amount_percent_matches. 105 163 preg_match_all('/{RIMPLENET_CONSTANT_VAR_\S*_PERCENT_OF_INVESTMENT_AMOUNT}/', $rules, $inv_amount_percent_matches); 106 164 107 165 108 166 //Any matches will be in our $inv_amount_percent_matches array of array 109 167 foreach($inv_amount_percent_matches[0] as $inv_amount_percent_match ){ … … 128 186 } 129 187 else{ 130 $status = $rules;188 $status = $rules; 131 189 } 132 190 -
rimplenet/trunk/includes/class-package-plans-and-rules.php
r2574985 r2575892 296 296 { 297 297 298 $post_per_page = rand(50,500); 298 299 $txn_loop = new WP_Query( 299 300 array( 300 301 'post_type' => 'rimplenettransaction', 301 'posts_per_page' => 50, // get 50 transaction.302 'posts_per_page' => $post_per_page, // get posts. 302 303 'order' => 'ASC', 303 304 'post_status' => 'publish', … … 310 311 ), 311 312 array( 312 'key' => 'package_investment_rule_executed', 313 'value' => 'yes', 314 'compare' => '!=', 313 'key' => 'invesment_returned', 314 'compare' => 'NOT EXISTS', 315 315 ), 316 316 ), -
rimplenet/trunk/includes/layouts/rimplenet-investment-form.php
r2503129 r2575892 1 1 <?php 2 //Included from shortcode in includes/class-investments.php 3 //use case [rimplenet-investment-form linked_package="868" wallet_id="eth,blcc" min="eth:0.1,blcc:20" max="eth:10,blcc:5000" time_to_return_invested_amount="+3 hours"] 2 4 if(!is_user_logged_in()) { 3 5 ?> … … 14 16 } 15 17 ?> 18 16 19 <?php 17 //Included from shortcode in includes/class-investments.php18 //use case [rimplenet-investment-form linked_package="868" wallet_id="eth,blcc" min="eth:0.1,blcc:20" max="eth:10,blcc:5000"]19 20 global $current_user; 20 21 wp_get_current_user(); … … 26 27 'linked_package' => '', 27 28 'wallet_id' => 'all', 29 'time_to_return_invested_amount' => '', 28 30 'min' => '0', 29 31 'max' => INF, … … 38 40 $linked_package = $atts['linked_package']; 39 41 $wallet_id = $atts['wallet_id']; 42 $time_to_return_invested_amount = $atts['time_to_return_invested_amount']; 40 43 $min = $atts['min']; 41 44 $max = $atts['max']; … … 117 120 $status_success = 'Investment Successful'; 118 121 if(!empty($linked_package)){ 119 update_post_meta($investment_info,'linked_package',$linked_package);122 update_post_meta($investment_info,'linked_package',$linked_package); 120 123 } 124 if(!empty($time_to_return_invested_amount)){ 125 $time_to_return_investment = strtotime($time_to_return_invested_amount); 126 update_post_meta($investment_info,'time_for_invested_amount_to_be_returned',$time_to_return_investment); 127 } 128 121 129 do_action('rimplenet_investment_successful', $investment_info, $current_user, $wallet_id, $amount,$note ); 122 130 -
rimplenet/trunk/rimplenet.php
r2574985 r2575892 17 17 * Plugin URI: https://rimplenet.com 18 18 * Description: Rimplenet FinTech | E-Banking | E-Wallets | Investments Plugin | MLM | Matrix Tree | Referral Manager 19 * Version: 1.1.1 519 * Version: 1.1.16 20 20 * Author: Nellalink 21 21 * Author URI: https://rimplenet.com … … 35 35 * Using SemVer - https://semver.org 36 36 */ 37 define( 'RIMPLENET_VERSION', '1.1.1 ' );37 define( 'RIMPLENET_VERSION', '1.1.16' ); 38 38 39 39 /**
Note: See TracChangeset
for help on using the changeset viewer.