Module com.prog3.ipt
Class PhoneNumberBillPaymentMethod
java.lang.Object
com.prog3.ipt.Model.PaymentMethodClasses.PhoneNumberBillPaymentMethod
- All Implemented Interfaces:
PaymentMethodStrategy
PhoneNumberBillPaymentMethod is a concrete class that implements PaymentMethodStrategy interface. This
class represents a phone number bill payment
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPhoneNumberBillPaymentMethod
(String phoneNumber) PhoneNumberBillPaymentMethod constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks that the data entered by the user for the payment have been made successfullyboolean
int
hashCode()
boolean
pay
(double paymentAmount) Makes the payment by the userprivate void
setPhoneNumber
(String phoneNumber) toString()
-
Field Details
-
phoneNumber
-
-
Constructor Details
-
PhoneNumberBillPaymentMethod
PhoneNumberBillPaymentMethod constructor- Parameters:
phoneNumber
- Phone number associated with phoneNumber bill payment
-
-
Method Details
-
setPhoneNumber
-
getPhoneNumber
-
pay
public boolean pay(double paymentAmount) Makes the payment by the user- Specified by:
pay
in interfacePaymentMethodStrategy
- Parameters:
paymentAmount
- Total amount to be paid by the user- Returns:
- true if transaction was successful, otherwise false
-
checkPaymentMethodData
public boolean checkPaymentMethodData()Checks that the data entered by the user for the payment have been made successfully- Specified by:
checkPaymentMethodData
in interfacePaymentMethodStrategy
- Returns:
- True if data are valid, otherwise false
-
equals
-
hashCode
public int hashCode() -
toString
-