Class PayPalPaymentMethod

java.lang.Object
com.prog3.ipt.Model.PaymentMethodClasses.PayPalPaymentMethod
All Implemented Interfaces:
PaymentMethodStrategy

public class PayPalPaymentMethod extends Object implements PaymentMethodStrategy
PayPalPaymentMethod is a concrete class that implements PaymentMethodStrategy interface. This class represents a PayPal payment
  • Field Details

    • email

      private String email
    • password

      private String password
  • Constructor Details

    • PayPalPaymentMethod

      public PayPalPaymentMethod(String email, String password)
      PayPalPaymentMethod constructor
      Parameters:
      email - Email associated with the user PayPal account
      password - Password associated with the user PayPal account
  • Method Details

    • setEmail

      private void setEmail(String email)
    • setPassword

      private void setPassword(String password)
    • getEmail

      public String getEmail()
    • getPassword

      public String getPassword()
    • pay

      public boolean pay(double paymentAmount)
      Makes the payment by the user
      Specified by:
      pay in interface PaymentMethodStrategy
      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 interface PaymentMethodStrategy
      Returns:
      True if data are valid or false if not
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object