class Moip::Payment

Attributes

creation_date[RW]
customer_code[RW]
id[RW]
invoice[RW]
moip_id[RW]
payment_method[RW]
status[RW]
subscription_code[RW]

Public Instance Methods

attributes() click to toggle source
# File lib/moip/models/payment.rb, line 9
def attributes
        { 
                "id" => id,
                "moip_id" => moip_id,
                "status" => status,
                "subscription_code" => subscription_code,
                "customer_code" => customer_code,
                "invoice" => invoice,
                "payment_method" => payment_method,
                "creation_date" => creation_date
        }
end
find() click to toggle source
# File lib/moip/models/payment.rb, line 41
def find
        response = self.class.get(base_url(:payments, :code => self.id), default_header).parsed_response
        self.set_parameters response unless response.nil?
end
load() click to toggle source
# File lib/moip/models/payment.rb, line 36
def load
        list = self.class.get(base_url(:invoices, :code => self.invoice, :status => "payments"), default_header).parsed_response
        self.payments = list["payments"]
end
payments() click to toggle source
# File lib/moip/models/payment.rb, line 32
def payments
        @payments ||= self.payments = self.load
end
payments=(hash) click to toggle source
# File lib/moip/models/payment.rb, line 22
def payments= hash
        @payments = []
        hash.each do |e|
                payment = Moip::Payment.new
                payment.set_parameters e
                @payments << payment
        end
        @payments
end