Class: PaypalServerSdk::PaypalWalletStoredCredential
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PaypalWalletStoredCredential
- Defined in:
- lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb
Overview
Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored.
Instance Attribute Summary collapse
-
#charge_pattern ⇒ UsagePattern
DEPRECATED.
-
#payment_initiator ⇒ PaymentInitiator
The person or party who initiated or triggered the payment.
-
#usage ⇒ StoredPaymentSourceUsageType
Indicates if this is a ‘first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).
-
#usage_pattern ⇒ UsagePattern
Expected business/pricing model for the billing agreement.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(payment_initiator:, charge_pattern: SKIP, usage_pattern: SKIP, usage: StoredPaymentSourceUsageType::DERIVED) ⇒ PaypalWalletStoredCredential
constructor
A new instance of PaypalWalletStoredCredential.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(payment_initiator:, charge_pattern: SKIP, usage_pattern: SKIP, usage: StoredPaymentSourceUsageType::DERIVED) ⇒ PaypalWalletStoredCredential
Returns a new instance of PaypalWalletStoredCredential.
56 57 58 59 60 61 62 63 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 56 def initialize(payment_initiator:, charge_pattern: SKIP, usage_pattern: SKIP, usage: StoredPaymentSourceUsageType::DERIVED) @payment_initiator = payment_initiator @charge_pattern = charge_pattern unless charge_pattern == SKIP @usage_pattern = usage_pattern unless usage_pattern == SKIP @usage = usage unless usage == SKIP end |
Instance Attribute Details
#charge_pattern ⇒ UsagePattern
DEPRECATED. Expected business/pricing model for the billing agreement, Please use usage_pattern instead.
21 22 23 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 21 def charge_pattern @charge_pattern end |
#payment_initiator ⇒ PaymentInitiator
The person or party who initiated or triggered the payment.
16 17 18 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 16 def payment_initiator @payment_initiator end |
#usage ⇒ StoredPaymentSourceUsageType
Indicates if this is a ‘first` or `subsequent` payment using a stored payment source (also referred to as stored credential or card on file).
30 31 32 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 30 def usage @usage end |
#usage_pattern ⇒ UsagePattern
Expected business/pricing model for the billing agreement.
25 26 27 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 25 def usage_pattern @usage_pattern end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment_initiator = hash.key?('payment_initiator') ? hash['payment_initiator'] : nil charge_pattern = hash.key?('charge_pattern') ? hash['charge_pattern'] : SKIP usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP usage = hash['usage'] ||= StoredPaymentSourceUsageType::DERIVED # Create object from extracted values. PaypalWalletStoredCredential.new(payment_initiator: payment_initiator, charge_pattern: charge_pattern, usage_pattern: usage_pattern, usage: usage) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['payment_initiator'] = 'payment_initiator' @_hash['charge_pattern'] = 'charge_pattern' @_hash['usage_pattern'] = 'usage_pattern' @_hash['usage'] = 'usage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 49 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 43 def self.optionals %w[ charge_pattern usage_pattern usage ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
92 93 94 95 96 97 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 92 def inspect class_name = self.class.name.split('::').last "<#{class_name} payment_initiator: #{@payment_initiator.inspect}, charge_pattern:"\ " #{@charge_pattern.inspect}, usage_pattern: #{@usage_pattern.inspect}, usage:"\ " #{@usage.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 89 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_stored_credential.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} payment_initiator: #{@payment_initiator}, charge_pattern:"\ " #{@charge_pattern}, usage_pattern: #{@usage_pattern}, usage: #{@usage}>" end |