Sha256: 237edf0e5cd69b5b2ba9013fb99192e376efc2360f1352678324888e65c6454f

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

module Moip2
  module Resource

    class Order < SimpleDelegator

      attr_reader :client, :payment_api, :external_id

      def initialize(client, response)
        super(response)
        @client = client

        if response.respond_to?(:external_id)
          @payment_api = PaymentApi.new(client)
          @external_id = response.external_id
        end
      end

      def create_payment(payment)
        payment_api.create(external_id, payment)
      end

    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
moip2-0.1.4 lib/moip2/resource/order.rb
moip2-0.1.3 lib/moip2/resource/order.rb
moip2-0.1.1 lib/moip2/resource/order.rb
moip2-0.1.0 lib/moip2/resource/order.rb