Class: Adyen::API::PaymentService::ModificationResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/adyen/api/payment_service.rb

Class Attribute Summary collapse

Attributes inherited from Response

#http_response

Instance Method Summary collapse

Methods inherited from Response

#body, #fault_message, #http_failure?, #initialize, response_attrs, #server_error?, #xml_querier

Constructor Details

This class inherits a constructor from Adyen::API::Response

Class Attribute Details

.base_xpathObject



363
364
365
# File 'lib/adyen/api/payment_service.rb', line 363

def base_xpath
  @base_xpath
end

.request_received_valueObject



363
364
365
# File 'lib/adyen/api/payment_service.rb', line 363

def request_received_value
  @request_received_value
end

Instance Method Details

#paramsObject



374
375
376
377
378
379
380
381
# File 'lib/adyen/api/payment_service.rb', line 374

def params
  @params ||= xml_querier.xpath(self.class.base_xpath) do |result|
    {
      :psp_reference  => result.text('./payment:pspReference'),
      :response       => result.text('./payment:response')
    }
  end
end

#success?Boolean

This only returns whether or not the request has been successfully received. Check the subsequent notification to see if the payment was actually mutated.

Returns:

  • (Boolean)


370
371
372
# File 'lib/adyen/api/payment_service.rb', line 370

def success?
  super && params[:response] == self.class.request_received_value
end