Class: Paymongo::Entities::PaymentIntent

Inherits:
BaseEntity
  • Object
show all
Defined in:
lib/paymongo/entities/payment_intent.rb

Direct Known Subclasses

Attributes::PaymentIntents::NextAction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_resource) ⇒ PaymentIntent

Returns a new instance of PaymentIntent.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/paymongo/entities/payment_intent.rb', line 24

def initialize(api_resource)
  @id = api_resource.id
  @amount = api_resource.attributes['amount']
  @capture_type = api_resource.attributes['capture_type']
  @client_key = api_resource.attributes['client_key']
  @currency = api_resource.attributes['currency']
  @description = api_resource.attributes['description']
  @livemode = api_resource.attributes['livemode']
  @statement_descriptor = api_resource.attributes['statement_descriptor']
  @status = api_resource.attributes['status']
  @last_payment_error = api_resource.attributes['last_payment_error']
  @payment_method_allowed = api_resource.attributes['payment_method_allowed']
  @payments = api_resource.attributes['payments'] #TODO: ENG-21218 PayMongo-Ruby - Map payments attribute to array of payment entities
  @next_action = next_action(api_resource.attributes['next_action'])
  @payment_method = api_resource.attributes['payment_method']
  @payment_method_options = api_resource.attributes['payment_method_options']
  @metadata = api_resource.attributes['metadata']
  @setup_future_usage = api_resource.attributes['setup_future_usage']
  @created_at = api_resource.attributes['created_at']
  @updated_at = api_resource.attributes['updated_at']
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#capture_typeObject (readonly)

Returns the value of attribute capture_type.



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

def capture_type
  @capture_type
end

#client_keyObject (readonly)

Returns the value of attribute client_key.



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

def client_key
  @client_key
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#last_payment_errorObject (readonly)

Returns the value of attribute last_payment_error.



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

def last_payment_error
  @last_payment_error
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



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

def livemode
  @livemode
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#next_action(data) ⇒ Object (readonly)

Returns the value of attribute next_action.



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

def next_action
  @next_action
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



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

def payment_method
  @payment_method
end

#payment_method_allowedObject (readonly)

Returns the value of attribute payment_method_allowed.



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

def payment_method_allowed
  @payment_method_allowed
end

#payment_method_optionsObject (readonly)

Returns the value of attribute payment_method_options.



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

def payment_method_options
  @payment_method_options
end

#paymentsObject (readonly)

Returns the value of attribute payments.



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

def payments
  @payments
end

#setup_future_usageObject (readonly)

Returns the value of attribute setup_future_usage.



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

def setup_future_usage
  @setup_future_usage
end

#statement_descriptorObject (readonly)

Returns the value of attribute statement_descriptor.



4
5
6
# File 'lib/paymongo/entities/payment_intent.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_intent.rb', line 4

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end