java.lang.Object
com.prog3.ipt.Model.PaymentMethodClasses.PayPalPaymentMethod
- All Implemented Interfaces:
PaymentMethodStrategy
PayPalPaymentMethod is a concrete class that implements PaymentMethodStrategy interface. This class
represents a PayPal payment
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPayPalPaymentMethod
(String email, String password) PayPalPaymentMethod constructor -
Method Summary
-
Field Details
-
email
-
password
-
-
Constructor Details
-
PayPalPaymentMethod
PayPalPaymentMethod constructor- Parameters:
email
- Email associated with the user PayPal accountpassword
- Password associated with the user PayPal account
-
-
Method Details
-
setEmail
-
setPassword
-
getEmail
-
getPassword
-
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 or false if not
-
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 or false if not
-
equals
-
hashCode
public int hashCode() -
toString
-