Class: MundiApi::UpdateSubscriptionPaymentMethodRequest
- Defined in:
- lib/mundi_api/models/update_subscription_payment_method_request.rb
Overview
Request for updating a subscription’s payment method
Instance Attribute Summary collapse
-
#card ⇒ CreateCardRequest
Card data.
-
#card_id ⇒ String
Card id.
-
#payment_method ⇒ String
The new payment method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(payment_method = nil, card_id = nil, card = nil) ⇒ UpdateSubscriptionPaymentMethodRequest
constructor
A new instance of UpdateSubscriptionPaymentMethodRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(payment_method = nil, card_id = nil, card = nil) ⇒ UpdateSubscriptionPaymentMethodRequest
Returns a new instance of UpdateSubscriptionPaymentMethodRequest.
30 31 32 33 34 35 36 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 30 def initialize(payment_method = nil, card_id = nil, card = nil) @payment_method = payment_method @card_id = card_id @card = card end |
Instance Attribute Details
#card ⇒ CreateCardRequest
Card data
17 18 19 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 17 def card @card end |
#card_id ⇒ String
Card id
13 14 15 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 13 def card_id @card_id end |
#payment_method ⇒ String
The new payment method
9 10 11 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 9 def payment_method @payment_method end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment_method = hash['payment_method'] card_id = hash['card_id'] card = CreateCardRequest.from_hash(hash['card']) if hash['card'] # Create object from extracted values. UpdateSubscriptionPaymentMethodRequest.new(payment_method, card_id, card) end |
.names ⇒ Object
A mapping from model property names to API property names.
20 21 22 23 24 25 26 27 28 |
# File 'lib/mundi_api/models/update_subscription_payment_method_request.rb', line 20 def self.names if @_hash.nil? @_hash = {} @_hash['payment_method'] = 'payment_method' @_hash['card_id'] = 'card_id' @_hash['card'] = 'card' end @_hash end |