예제 #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;