class Adyen::API::PaymentService::BilletResponse
Constants
- RECEIVED
Public Instance Methods
invalid_request?()
click to toggle source
# File lib/adyen/api/payment_service.rb 264 def invalid_request? 265 !fault_message.nil? 266 end
params()
click to toggle source
# File lib/adyen/api/payment_service.rb 240 def params 241 @params ||= xml_querier.xpath('//payment:authoriseResponse/payment:paymentResult') do |result| 242 result_code = result.text('./payment:resultCode') 243 attributes = Hash.new('') 244 245 if result_code == RECEIVED 246 attributes = result.children[0].children.map do |child| 247 { child.children[0].text => child.children[1].text } 248 end 249 attributes = attributes.reduce({}, :merge) 250 end 251 252 { 253 :psp_reference => result.text('./payment:pspReference'), 254 :result_code => result_code, 255 :billet_url => attributes['boletobancario.url'], 256 :barcode => attributes['boletobancario.barCodeReference'], 257 :due_date => convert_to_date(attributes['boletobancario.dueDate']), 258 :expiration_date => convert_to_date(attributes['boletobancario.expirationDate']), 259 :refusal_reason => (invalid_request? ? fault_message : result.text('./payment:refusalReason')) 260 } 261 end 262 end
success?()
click to toggle source
Calls superclass method
# File lib/adyen/api/payment_service.rb 236 def success? 237 super && params[:result_code] == RECEIVED 238 end
Private Instance Methods
convert_to_date(value)
click to toggle source
# File lib/adyen/api/payment_service.rb 270 def convert_to_date(value) 271 Date.parse(value) 272 rescue ArgumentError 273 nil 274 end