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



332
333
334
# File 'lib/adyen/api/payment_service.rb', line 332

def base_xpath
  @base_xpath
end

.request_received_valueObject



332
333
334
# File 'lib/adyen/api/payment_service.rb', line 332

def request_received_value
  @request_received_value
end

Instance Method Details

#paramsObject



343
344
345
346
347
348
349
350
# File 'lib/adyen/api/payment_service.rb', line 343

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)


339
340
341
# File 'lib/adyen/api/payment_service.rb', line 339

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