Class: Paymongo::Entities::Payment

Inherits:
BaseEntity show all
Defined in:
lib/paymongo/entities/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_resource) ⇒ Payment

Returns a new instance of Payment.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/paymongo/entities/payment.rb', line 33

def initialize(api_resource)
  @id = api_resource.id
  @access_url = api_resource.attributes['access_url']
  @amount = api_resource.attributes['amount']
  @balance_transaction_id = api_resource.attributes['balance_transaction_id']
  @billing = BillingEntity.new(api_resource.attributes['billing'])
  @currency = api_resource.attributes['currency']
  @description = api_resource.attributes['description']
  @disputed = api_resource.attributes['disputed']
  @external_reference_number = api_resource.attributes['external_reference_number']
  @fee = api_resource.attributes['fee']
  @foreign_fee = api_resource.attributes['foreign_fee']
  @livemode = api_resource.attributes['livemode']
  @metadata = api_resource.attributes['metadata']
  @net_amount = api_resource.attributes['net_amount']
  @origin = api_resource.attributes['origin']
  @payment_intent_id = api_resource.attributes['payment_intent_id']
  @payout = api_resource.attributes['payout']
  @refunds = api_resource.attributes['refunds']
  @source = api_resource.attributes['source']
  @statement_descriptor = api_resource.attributes['statement_descriptor']
  @status = api_resource.attributes['status']
  @tax_amount = api_resource.attributes['tax_amount']
  @taxes = api_resource.attributes['taxes']
  @available_at = api_resource.attributes['available_at']
  @created_at = api_resource.attributes['created_at']
  @credited_at = api_resource.attributes['credited_at']
  @paid_at = api_resource.attributes['paid_at']
  @updated_at = api_resource.attributes['updated_at']
end

Instance Attribute Details

#access_urlObject (readonly)

Returns the value of attribute access_url.



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

def access_url
  @access_url
end

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#available_atObject (readonly)

Returns the value of attribute available_at.



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

def available_at
  @available_at
end

#balance_transaction_idObject (readonly)

Returns the value of attribute balance_transaction_id.



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

def balance_transaction_id
  @balance_transaction_id
end

#billingObject (readonly)

Returns the value of attribute billing.



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

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#credited_atObject (readonly)

Returns the value of attribute credited_at.



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

def credited_at
  @credited_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#disputedObject (readonly)

Returns the value of attribute disputed.



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

def disputed
  @disputed
end

#external_reference_numberObject (readonly)

Returns the value of attribute external_reference_number.



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

def external_reference_number
  @external_reference_number
end

#feeObject (readonly)

Returns the value of attribute fee.



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

def fee
  @fee
end

#foreign_feeObject (readonly)

Returns the value of attribute foreign_fee.



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

def foreign_fee
  @foreign_fee
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



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

def livemode
  @livemode
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#net_amountObject (readonly)

Returns the value of attribute net_amount.



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

def net_amount
  @net_amount
end

#originObject (readonly)

Returns the value of attribute origin.



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

def origin
  @origin
end

Returns the value of attribute paid_at.



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

def paid_at
  @paid_at
end

#payment_intent_idObject (readonly)

Returns the value of attribute payment_intent_id.



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

def payment_intent_id
  @payment_intent_id
end

#payoutObject (readonly)

Returns the value of attribute payout.



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

def payout
  @payout
end

#refundsObject (readonly)

Returns the value of attribute refunds.



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

def refunds
  @refunds
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

#statement_descriptorObject (readonly)

Returns the value of attribute statement_descriptor.



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

def statement_descriptor
  @statement_descriptor
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#tax_amountObject (readonly)

Returns the value of attribute tax_amount.



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

def tax_amount
  @tax_amount
end

#taxesObject (readonly)

Returns the value of attribute taxes.



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

def taxes
  @taxes
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end