Ruby implementation for handling business rules for a payment system