Class: Paymill::Refund

Inherits:
Base
  • Object
show all
Defined in:
lib/paymill/models/refund.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#app_id, #created_at, #id, #updated_at

Class Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Paymill::Restful::All

#all

Methods included from Paymill::Restful::Find

#find

Methods included from Paymill::Restful::Create

#create

Constructor Details

This class inherits a constructor from Paymill::Base

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def amount
  @amount
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def description
  @description
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def livemode
  @livemode
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def response_code
  @response_code
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def status
  @status
end

#transactionObject (readonly)

Returns the value of attribute transaction.



4
5
6
# File 'lib/paymill/models/refund.rb', line 4

def transaction
  @transaction
end

Class Method Details

.create(transaction, attributes = {}) ⇒ Object

Raises:

  • (ArgumentError)


6
7
8
9
10
# File 'lib/paymill/models/refund.rb', line 6

def self.create( transaction, attributes = {} )
  raise ArgumentError unless create_with?( attributes.keys )
  response = Paymill.request( Http.post( name.demodulize.tableize, transaction.id, Restful.normalize( attributes ) ) )
  new( response['data'] )
end