Changeset 2463950
- Timestamp:
- 01/27/2021 11:16:50 PM (5 years ago)
- Location:
- rimplenet/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (3 diffs)
-
includes/class-emails.php (modified) (1 diff)
-
includes/class-wallets.php (modified) (5 diffs)
-
rimplenet.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rimplenet/trunk/README.txt
r2463683 r2463950 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.6 7 Stable tag: 1.1. 27 Stable tag: 1.1.3 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 80 80 81 81 == Changelog == 82 = 1.1. 2=82 = 1.1.3 = 83 83 * Admin can now Credit or Debit User with a form on backend via WP-ADMIN-> SETTINGS: WALLET 84 84 * Notification Email on Wallet Funds Additions or Withdrawal has been enabled. … … 104 104 105 105 == Upgrade Notice == 106 = 1.1. 2=106 = 1.1.3 = 107 107 * Admin can now Credit or Debit User with a form on backend via WP-ADMIN-> SETTINGS: WALLET 108 108 * Notification Email on Wallet Funds Additions or Withdrawal has been enabled. -
rimplenet/trunk/includes/class-emails.php
r2463673 r2463950 5 5 public function __construct() { 6 6 7 add_action('after_add_user_mature_funds_to_wallet', array($this,'sendEmailNotification'), 10, 6);7 add_action('after_add_user_mature_funds_to_wallet', array($this,'sendEmailNotification'), 10, 7 ); 8 8 9 9 } 10 10 11 function sendEmailNotification($txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags )11 function sendEmailNotification($txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags,$tnx_type) 12 12 { 13 13 $txn_id = $txn_add_bal_id; 14 14 $wallet_obj = new Rimplenet_Wallets(); 15 15 $all_wallets = $wallet_obj->getWallets(); 16 16 17 $user_wdr_bal = $wallet_obj->get_withdrawable_wallet_bal($user_id, $wallet_id); 18 $user_non_wdr_bal = $wallet_obj->get_nonwithdrawable_wallet_bal($user_id, $wallet_id); 19 $user_balance_total = $wallet_obj->get_total_wallet_bal($user_id,$wallet_id); 20 21 $dec = $all_wallets[$wallet_id]['decimal']; 22 $symbol = $all_wallets[$wallet_id]['symbol']; 23 $symbol_position = $all_wallets[$wallet_id]['symbol_position']; 24 if($symbol_position=='right'){ 25 $amount_formatted = number_format($amount_to_add,$dec)." ".$symbol; 26 $user_wdr_bal_formatted = number_format($user_wdr_bal,$dec)." ".$symbol; 27 $user_non_wdr_bal_formatted = number_format($user_non_wdr_bal,$dec)." ".$symbol; 28 $user_balance_total_formatted = number_format($user_balance_total,$dec)." ".$symbol; 29 30 } 31 else{ 32 $amount_formatted = $symbol.number_format($amount_to_add,$dec); 33 $user_wdr_bal_formatted = $symbol.number_format($user_wdr_bal,$dec); 34 $user_non_wdr_bal_formatted = $symbol.number_format($user_non_wdr_bal,$dec); 35 $user_balance_total_formatted = $symbol.number_format($user_balance_total,$dec); 36 37 } 38 17 39 $website_url = parse_url(get_bloginfo('url')); 18 40 $domain_name = trim($website_url['host'] ? $website_url['host'] : array_shift(explode('/', $website_url['path'], 2))); 41 42 $blogurl = get_bloginfo('url'); 43 44 $blogname = get_bloginfo('name'); 45 $blogname_uppercase = strtoupper($blogname); 19 46 20 47 $user_info = get_user_by('id', $user_id); 21 48 $user_email = $user_info->user_email; 22 49 50 $username = $user_info->user_login; 51 $username_uppercase = strtoupper($username); 52 53 $tnx_type_uppercase = strtoupper($tnx_type); 54 55 $date_time = get_the_date('D, M j, Y', $txn_id).'<br>'.get_the_date('g:i A', $txn_id); 56 23 57 $to = $user_email; 24 $subject = "CREDIT of $amount_to_add on ".get_bloginfo('name')." - TXN #$txn_add_bal_id"; 25 $body = 'A new transaction has occured on your account'; 58 59 $subject = "$tnx_type_uppercase of $amount_formatted ON $blogname_uppercase - TXN #$txn_add_bal_id"; 60 61 $body ="<style> 62 table,td { 63 border: 1px solid white; 64 border-collapse: collapse; 65 66 67 } 68 69 </style> 70 <div style='background-color:#fff'> 71 72 <table style='width:100%'> 73 <tr> 74 <th colspan='2' style='background: #ccc;padding: 15px;'> 75 $blogname_uppercase : A NEW TRANSACTION HAS OCCURED ON YOUR ACCOUNT ~ @{$username} 76 </th> 77 </tr> 78 79 <tr> 80 <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION TYPE</strong></td> 81 <td style='background-color:#eee; padding: 20px; text-align: left;'> $tnx_type_uppercase </td> 82 </tr> 83 84 <tr> 85 <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>TRANSACTION AMOUNT</strong></td> 86 <td style='background-color:#eee; padding: 20px; text-align: left;'> $amount_formatted </td> 87 </tr> 88 89 <tr> 90 <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION NOTE</strong></td> 91 <td style='background-color:#eee; padding: 20px; text-align: left;'> $note </td> 92 </tr> 93 94 <tr> 95 <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>UNCLEARED BALANCE</strong></td> 96 <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_non_wdr_bal_formatted </td> 97 </tr> 98 99 <tr> 100 <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>CLEARED/ AVAILABLE BALANCE</strong></td> 101 <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_wdr_bal_formatted </td> 102 </tr> 103 104 <tr> 105 <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>TOTAL BALANCE</strong></td> 106 <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_balance_total_formatted </td> 107 </tr> 108 109 <tr> 110 <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION DATE / TIME</strong></td> 111 <td style='background-color:#eee; padding: 20px; text-align: left;'> $date_time </td> 112 </tr> 113 114 </table> 115 <p style='background:#2d2f33; color:white; padding:25px; text-align:center;'> 116 This email was sent from <a href='$blogurl' style='color: #d28787;'> $blogname_uppercase </a> 117 </p> 118 <div/>"; 119 26 120 $headers = "MIME-Version: 1.0" . "\r\n"; 27 121 $headers .= "Content-type: text/html; charset=".get_bloginfo('charset')."" . "\r\n"; 28 $headers .= "From: Transaction Notifier <noreply@".$domain_name.">" . "\r\n";122 $headers .= "From: Transaction Notifier ~ $blogname <noreply@".$domain_name.">" . "\r\n"; 29 123 30 124 -
rimplenet/trunk/includes/class-wallets.php
r2463673 r2463950 128 128 129 129 130 $user_wdr_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);131 $user_non_wdr_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);132 133 $walllets = $this->getWallets();130 $user_wdr_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id); 131 $user_non_wdr_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id); 132 133 $walllets = $this->getWallets(); 134 134 $dec = $walllets[$wallet_id]['decimal']; 135 135 $min_wdr_amount = $walllets[$wallet_id]['min_wdr_amount']; … … 139 139 140 140 $balance = $symbol.number_format($balance,$dec); 141 141 142 142 if (empty($amount_to_withdraw) OR empty($wallet_id) ) { 143 $wdr_info = 'One or more compulsory field is empty';144 }145 elseif ($amount_to_withdraw>$user_wdr_bal) {146 $wdr_info = 'Amount to withdraw - <strong>['.$symbol.number_format($amount_to_withdraw,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_wdr_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. $symbol.number_format($user_non_wdr_bal,$dec).'] )</strong> cannot be withdrawn until maturity';147 }148 149 elseif ($amount_to_withdraw<$min_wdr_amount) {150 $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is below minimum withdrawal amount, input amount not less than '.$min_wdr_amount;151 }152 elseif ($amount_to_withdraw>$max_wdr_amount) {153 $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is above maximum withdrawal amount, input amount not more than '.$max_wdr_amount;154 }155 else{156 157 143 $wdr_info = 'One or more compulsory field is empty'; 144 } 145 elseif ($amount_to_withdraw>$user_wdr_bal) { 146 $wdr_info = 'Amount to withdraw - <strong>['.$symbol.number_format($amount_to_withdraw,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_wdr_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. $symbol.number_format($user_non_wdr_bal,$dec).'] )</strong> cannot be withdrawn until maturity'; 147 } 148 149 elseif ($amount_to_withdraw<$min_wdr_amount) { 150 $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is below minimum withdrawal amount, input amount not less than '.$min_wdr_amount; 151 } 152 elseif ($amount_to_withdraw>$max_wdr_amount) { 153 $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is above maximum withdrawal amount, input amount not more than '.$max_wdr_amount; 154 } 155 else{ 156 157 158 158 159 159 $amount_to_withdraw = $amount_to_withdraw * -1; … … 180 180 181 181 } 182 }182 } 183 183 wp_reset_postdata(); 184 184 return $wdr_info; … … 189 189 190 190 $current_user = get_user_by('ID', $user_id); 191 $current_user_id = $current_user ->ID;192 191 $current_user_id = $current_user ->ID; 192 193 193 $user_transfer_to = get_user_by('login', $transfer_to_user); 194 $transfer_to_user_id = $user_transfer_to->ID;195 196 $min_transfer_amt = 0;197 $user_transfer_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);198 $user_non_transfer_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);199 200 $walllets = $this->getWallets();194 $transfer_to_user_id = $user_transfer_to->ID; 195 196 $min_transfer_amt = 0; 197 $user_transfer_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id); 198 $user_non_transfer_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id); 199 200 $walllets = $this->getWallets(); 201 201 $dec = $walllets[$wallet_id]['decimal']; 202 202 $symbol = $walllets[$wallet_id]['symbol']; 203 203 $name = $walllets[$wallet_id]['name']; 204 204 $balance = $symbol.number_format($balance,$dec); 205 206 205 206 207 207 if (empty($user_id) OR empty($amount_to_transfer) OR empty($wallet_id) OR empty($transfer_to_user) ) { 208 $transfer_info = 'One or more compulsory field is empty';209 }210 elseif ($amount_to_transfer>$user_transfer_bal) {211 $transfer_info = 'Amount to transfer - <strong>['.$symbol.number_format($amount_to_transfer,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_transfer_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. $symbol.number_format($user_non_transfer_bal,$dec).'] )</strong> cannot be transferred until maturity';212 }213 elseif ($amount_to_transfer<$min_transfer_amt) {214 $transfer_info = 'Requested amount ['.$amount_to_transfer.'] is below minimum transfer amount, input amount not less than '.$min_transfer_amt;215 }216 elseif (!username_exists($user_transfer_to->user_login)) {217 $transfer_info = 'User with the username <b>['.$transfer_to_user.']</b> does not exist, please crosscheck the username';218 }219 else{ // all is good, make transfer220 221 //transfer funds to user222 208 $transfer_info = 'One or more compulsory field is empty'; 209 } 210 elseif ($amount_to_transfer>$user_transfer_bal) { 211 $transfer_info = 'Amount to transfer - <strong>['.$symbol.number_format($amount_to_transfer,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_transfer_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet - ['. $symbol.number_format($user_non_transfer_bal,$dec).'] )</strong> cannot be transferred until maturity'; 212 } 213 elseif ($amount_to_transfer<$min_transfer_amt) { 214 $transfer_info = 'Requested amount ['.$amount_to_transfer.'] is below minimum transfer amount, input amount not less than '.$min_transfer_amt; 215 } 216 elseif (!username_exists($user_transfer_to->user_login)) { 217 $transfer_info = 'User with the username <b>['.$transfer_to_user.']</b> does not exist, please crosscheck the username'; 218 } 219 else{ // all is good, make transfer 220 221 //transfer funds to user 222 223 223 $amount_to_transfer_to_user = apply_filters('rimplenet_amount_to_transfer', $amount_to_transfer, $wallet_id, $transfer_to_user_id); 224 224 $txn_transfer_id1 = $this->add_user_mature_funds_to_wallet($transfer_to_user_id,$amount_to_transfer_to_user, $wallet_id,$note); … … 326 326 update_post_meta($txn_add_bal_id, 'funds_type', $key); 327 327 328 do_action("after_add_user_immature_funds_to_wallet",$txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags );328 do_action("after_add_user_immature_funds_to_wallet",$txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags,$tnx_type); 329 329 330 330 return $txn_add_bal_id; -
rimplenet/trunk/rimplenet.php
r2463683 r2463950 17 17 * Plugin URI: https://rimplenet.com 18 18 * Description: Rimplenet E-Banking | E-Wallets | Investments Plugin | MLM | Matrix Tree | Referral Manager | FinTech 19 * Version: 1.1. 219 * Version: 1.1.3 20 20 * Author: Nellalink 21 21 * Author URI: https://rimplenet.com
Note: See TracChangeset
for help on using the changeset viewer.