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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPhoneNumberBillPaymentMethod(String phoneNumber) PhoneNumberBillPaymentMethod constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks that the data entered by the user for the payment have been made successfullybooleaninthashCode()booleanpay(double paymentAmount) Makes the payment by the userprivate voidsetPhoneNumber(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:
payin 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:
checkPaymentMethodDatain interfacePaymentMethodStrategy- Returns:
- True if data are valid, otherwise false
-
equals
-
hashCode
public int hashCode() -
toString
-