/* Visa.java  */

package shopping;

//this class represents the Visa account...not the card

import java.beans.*;

public class Visa extends Object implements VetoableChangeListener {
    
    public static final double LIMIT = 2000.00;
    private double charges = 0.00;
    
    public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
        // Get the old value and new value of the property
        Object oldValue = evt.getOldValue();
        Object newValue = evt.getNewValue();
    
        // Determine if the change should be vetoed
        if ( ((Double) newValue + (Double) oldValue ) > LIMIT ) {
           throw new PropertyVetoException("Transaction denied. Purchase would exceed limit", evt);
        }
     }


}

