Class: Payrex::Entities::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/entities/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_resource) ⇒ Payment

Returns a new instance of Payment.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/entities/payment.rb', line 22

def initialize(api_resource)
  @id = api_resource.data["id"]
  @amount = api_resource.data["amount"]
  @amount_refunded = api_resource.data["amount_refunded"]
  @billing = api_resource.data["billing"]
  @currency = api_resource.data["currency"]
  @description = api_resource.data["description"]
  @fee = api_resource.data["fee"]
  @livemode = api_resource.data["livemode"]
  @metadata = api_resource.data["metadata"]
  @net_amount = api_resource.data["net_amount"]
  @payment_intent_id = api_resource.data["payment_intent_id"]
  @status = api_resource.data["status"]
  @customer = api_resource.data["customer"]
  @payment_method = api_resource.data["payment_method"]
  @refunded = api_resource.data["refunded"]
  @created_at = api_resource.data["created_at"]
  @updated_at = api_resource.data["updated_at"]
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/entities/payment.rb', line 4

def amount
  @amount
end

#amount_refundedObject (readonly)

Returns the value of attribute amount_refunded.



4
5
6
# File 'lib/entities/payment.rb', line 4

def amount_refunded
  @amount_refunded
end

#billingObject (readonly)

Returns the value of attribute billing.



4
5
6
# File 'lib/entities/payment.rb', line 4

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/entities/payment.rb', line 4

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



4
5
6
# File 'lib/entities/payment.rb', line 4

def currency
  @currency
end

#customerObject (readonly)

Returns the value of attribute customer.



4
5
6
# File 'lib/entities/payment.rb', line 4

def customer
  @customer
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/entities/payment.rb', line 4

def description
  @description
end

#feeObject (readonly)

Returns the value of attribute fee.



4
5
6
# File 'lib/entities/payment.rb', line 4

def fee
  @fee
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/entities/payment.rb', line 4

def id
  @id
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



4
5
6
# File 'lib/entities/payment.rb', line 4

def livemode
  @livemode
end

#metadataObject (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/entities/payment.rb', line 4

def 
  @metadata
end

#net_amountObject (readonly)

Returns the value of attribute net_amount.



4
5
6
# File 'lib/entities/payment.rb', line 4

def net_amount
  @net_amount
end

#payment_intent_idObject (readonly)

Returns the value of attribute payment_intent_id.



4
5
6
# File 'lib/entities/payment.rb', line 4

def payment_intent_id
  @payment_intent_id
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



4
5
6
# File 'lib/entities/payment.rb', line 4

def payment_method
  @payment_method
end

#refundedObject (readonly)

Returns the value of attribute refunded.



4
5
6
# File 'lib/entities/payment.rb', line 4

def refunded
  @refunded
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/entities/payment.rb', line 4

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



4
5
6
# File 'lib/entities/payment.rb', line 4

def updated_at
  @updated_at
end