Exemplo n.º 1
0
 public static function verifyBlacklist($data)
 {
     $settings = IniHandle::readini();
     if ($data['custom'] == 'blacklist_skype') {
         $price = $settings['skypebl'];
     } elseif ($data['custom'] == 'blacklist_ip') {
         $price = $settings['ipbl'];
     } else {
         Log::write('PayPal', 'No custom parameter, could not get product(Blacklist:skype/IP)');
         return;
     }
     Log::write('PayPal', 'Verifying Blacklist');
     $user = User::find($data['option_selection1']);
     if (empty($user)) {
         Log::write('PayPal', 'Blacklist verify: User does not exist');
         return View::make('msg.error')->with('error', 'User does not exist.');
     }
     if ($data['mc_gross'] != $price) {
         Log::write('PayPal', 'Blacklist verify: prices do not match');
         return View::make('msg.error')->with('error', 'Prices do not match');
     }
     if (Custblacklist::where('blacklist', '=', $data['option_selection2'])->count() != 0) {
         Log::write('PayPal', 'Blacklist verify: Blacklist variable already exists: ' . $data['option_selection2']) . ' -> continue process though';
         return true;
     }
     Custblacklist::create(array('user_id' => $data['option_selection1'], 'blacklist' => strtolower($data['option_selection2']), 'type' => $data['custom'] == 'blacklist_skype' ? 'skype' : 'ip', 'transaction_id' => $data['txn_id']));
     Log::write('PayPal', 'Blacklist verify: succeeded added blacklist: ' . $data['option_selection2']);
     return true;
 }