Class: Payment::PaypalStatusResult

Inherits:
Data
  • Object
show all
Defined in:
app/models/payment.rb

Overview

Outcome of a PayPal authorization status sync: a status symbol plus an
optional human-readable message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, message: nil) ⇒ Payment::PaypalStatusResult

Parameters:

  • status (Symbol)

    the outcome, e.g. :captured, :voided, :expired

  • message (String, nil) (defaults to: nil)

    human-readable detail



702
703
# File 'app/models/payment.rb', line 702

def initialize(status:, message: nil) = super
# @return [Boolean] true when the status leaves the payment usable

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



698
699
700
# File 'app/models/payment.rb', line 698

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



698
699
700
# File 'app/models/payment.rb', line 698

def status
  @status
end

Instance Method Details

#ok?Boolean

Returns true when the status leaves the payment usable.

Returns:

  • (Boolean)

    true when the status leaves the payment usable



704
# File 'app/models/payment.rb', line 704

def ok? = status.in?(%i[authorized reauthorized captured still_valid])