Class: ActiveMerchant::Billing::WorldpayGateway::MultiResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/worldpay.rb

Instance Attribute Summary collapse

Attributes inherited from Response

#authorization, #avs_result, #cvv_result, #message, #params, #test

Instance Method Summary collapse

Methods inherited from Response

#fraud_review?, #test?

Constructor Details

#initializeMultiResponse

Returns a new instance of MultiResponse.



254
255
256
# File 'lib/active_merchant/billing/gateways/worldpay.rb', line 254

def initialize
  @responses = []
end

Instance Attribute Details

#responsesObject (readonly)

Returns the value of attribute responses.



252
253
254
# File 'lib/active_merchant/billing/gateways/worldpay.rb', line 252

def responses
  @responses
end

Instance Method Details

#<<(response) ⇒ Object



258
259
260
261
262
263
264
# File 'lib/active_merchant/billing/gateways/worldpay.rb', line 258

def <<(response)
  if response.is_a?(MultiResponse)
    response.responses.each{|r| @responses << r}
  else
    @responses << response
  end
end

#success?Boolean

Returns:

  • (Boolean)


266
267
268
# File 'lib/active_merchant/billing/gateways/worldpay.rb', line 266

def success?
  @responses.all?{|r| r.success?}
end