Class: AdaptivePayments::AbstractResponse

Inherits:
JsonModel
  • Object
show all
Includes:
FaultMessage
Defined in:
lib/pp-adaptive/abstract_response.rb

Overview

AbstractResponse provides a JsonModel with the default behaviour for all responses

The ResponseEnvelope is already included by default. It does not need to be redeclared in descendants.

All responses have FaultMessage behaviour mixed in, so will behave as a FaultMessage if the API returns one.

Class Method Summary collapse

Methods included from FaultMessage

#first_error, included

Methods included from Aliases

#alias_param, #alias_params

Methods included from JsonModel::Parsing

#from_json, #to_attributes

Methods included from JsonModel::Writing

#to_hash, #to_json

Class Method Details

.operation(name = nil) ⇒ Symbol

Set or get the API operation

This method should be called in descendants, but is not currently used.

Parameters:

  • name (Symbol) (defaults to: nil)

    the name of the API operation as defined by PayPal, optional

Returns:

  • (Symbol)

    the name of the API operation as defined by PayPal



35
36
37
38
# File 'lib/pp-adaptive/abstract_response.rb', line 35

def operation(name = nil)
  @operation = name unless name.nil?
  @operation
end