Sha256: 201741e6a0be55c607506af294e6b25518a7d84c22a5f002696b2e07aba5d693

Contents?: true

Size: 688 Bytes

Versions: 16

Compression:

Stored size: 688 Bytes

Contents

module Spreedly

  class DeliverPaymentMethod < Transaction

    attr_reader :response
    attr_reader :payment_method, :receiver
    field :succeeded, type: :boolean

    def initialize(xml_doc)
      super
      @payment_method = PaymentMethod.new_from(xml_doc.at_xpath('.//payment_method'))
      @receiver = Receiver.new(xml_doc.at_xpath('.//receiver'))

      response_xml_doc = xml_doc.at_xpath('.//response')
      @response = response_xml_doc ? DeliverPaymentResponse.new(response_xml_doc) : nil
    end

  end

  class DeliverPaymentResponse
    include Fields

    field :status, :headers, :body

    def initialize(xml_doc)
      initialize_fields(xml_doc)
    end

  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spreedly-2.0.28 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.27 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.26 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.25 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.24 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.23 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.22 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.21 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.20 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.19 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.18 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.17 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.16 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.15 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.14 lib/spreedly/transactions/deliver_payment_method.rb
spreedly-2.0.13 lib/spreedly/transactions/deliver_payment_method.rb