Ejemplo n.º 1
0
//unset the class
unset($chars, $command, $charName);
//Check if the item was destroyed
if ($refund === false) {
    echo 'The website failed to refund the item. Please try again later or contact the administration.';
    die;
} else {
    if ($refund === true) {
        //Set the currency
        $finance->SetCurrency((int) $row['currency']);
        //Set the amount we are Giving
        $set = $finance->SetAmount((int) $row['price']);
        //Give coins to the user
        $Reward = $finance->Reward('Item Refund');
        //check if the coins ware not given
        if ($Reward !== true) {
            ItemRefundSystem::SetError($row['id'], 'The finance class failed to add the required amount to the user.');
            echo 'The website failed to update your account balance. Please contact the administration.';
            die;
        }
        ItemRefundSystem::RefundableSetStatus($row['id'], IRS_STATUS_REFUNDED);
        //register success message
        $ERRORS->registerSuccess('The item has been successfully refunded.');
        echo 'OK';
    } else {
        echo 'The system encoutenred the following error: ' . $refund;
        die;
    }
}
####################################################################
exit;
Ejemplo n.º 2
0
      
      		<!-- VOTE -->
      		<div class="vote-page">
      		
                <div class="page-desc-holder">
                    Refunding an item purchased from our store gives you back the full amount you paid.
                    <br/><br/>
                    The system requires your character to be online and the item must be in your character's bags.<br/>
                    You are allowed to use the Refund System 2 times a week.
                </div>
            
				<?php 
//Array storage for character data (less queries)
$characterData = array();
//Get the refundables
$res = ItemRefundSystem::GetRefundables();
?>
            	
                <div class="container_3 account-wide" align="center">
                    <div class="items">
                    
                    <?php 
if ($res) {
    while ($arr = $res->fetch()) {
        $GUID = $arr['character'];
        //Get the character data for this refund
        if (!isset($characterData[$GUID])) {
            $columns = array('name', 'class', 'level', 'race', 'gender');
            $characterData[$GUID] = $chars->getCharacterData($GUID, false, $columns);
            unset($columns);
        }
Ejemplo n.º 3
0
         $insert->bindParam(':itemId', $id, PDO::PARAM_INT);
         $insert->bindParam(':money', $moneyString, PDO::PARAM_STR);
         $insert->execute();
         unset($insert);
         //log into coin activity
         $ca = new CoinActivity();
         $ca->set_SourceType(CA_SOURCE_TYPE_NONE);
         $ca->set_SourceString('Item Purchase');
         $ca->set_CoinsType($currencyType);
         $ca->set_ExchangeType(CA_EXCHANGE_TYPE_MINUS);
         $ca->set_Amount($price);
         $ca->execute();
         unset($ca);
         $currencyType = $currency == 'silver' ? CURRENCY_SILVER : CURRENCY_GOLD;
         //Add the item as refundable
         $refundable = ItemRefundSystem::AddRefundable($row['entry'], $price, $currencyType, $characterGUID);
         //update the log
         $logs->update(false, 'The user has enough money, proceeding to item (id: ' . $id . ') sending.' . ($refundable ? ' Successfully added the item as refundable.' : ''));
         //sending... append the item entry to the items string for the SOAP command
         if (!$itemsString) {
             $itemsString = $row['entry'];
         } else {
             $itemsString .= ' ' . $row['entry'];
         }
         unset($currencyType, $price, $theTime);
     }
 } else {
     //save the item error
     $itemErrors[$index]['error'] = 'The selected currency for this item is invalid.';
     //log
     $logs->update(false, 'The user is using invalid currency for this purchase of item (id: ' . $id . ').', 'error');