Class: PaypalServerSdk::PaymentMethodPreference

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/payment_method_preference.rb

Overview

The customer and merchant payment preferences.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED, standard_entry_class_code: StandardEntryClassCode::WEB) ⇒ PaymentMethodPreference

Returns a new instance of PaymentMethodPreference.



48
49
50
51
52
53
54
55
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 48

def initialize(payee_preferred: PayeePaymentMethodPreference::UNRESTRICTED,
               standard_entry_class_code: StandardEntryClassCode::WEB)
  @payee_preferred = payee_preferred unless payee_preferred == SKIP
  unless standard_entry_class_code == SKIP
    @standard_entry_class_code =
      standard_entry_class_code
  end
end

Instance Attribute Details

#payee_preferredPayeePaymentMethodPreference

The merchant-preferred payment methods.



14
15
16
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 14

def payee_preferred
  @payee_preferred
end

#standard_entry_class_codeStandardEntryClassCode

NACHA (the regulatory body governing the ACH network) requires that API callers (merchants, partners) obtain the consumer’s explicit authorization before initiating a transaction. To stay compliant, you’ll need to make sure that you retain a compliant authorization for each transaction that you originate to the ACH Network using this API. ACH transactions are categorized (using SEC codes) by how you capture authorization from the Receiver (the person whose bank account is being debited or credited). PayPal supports the following SEC codes.



25
26
27
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 25

def standard_entry_class_code
  @standard_entry_class_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 58

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payee_preferred =
    hash['payee_preferred'] ||= PayeePaymentMethodPreference::UNRESTRICTED
  standard_entry_class_code =
    hash['standard_entry_class_code'] ||= StandardEntryClassCode::WEB

  # Create object from extracted values.
  PaymentMethodPreference.new(payee_preferred: payee_preferred,
                              standard_entry_class_code: standard_entry_class_code)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payee_preferred'] = 'payee_preferred'
  @_hash['standard_entry_class_code'] = 'standard_entry_class_code'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
41
# File 'lib/paypal_server_sdk/models/payment_method_preference.rb', line 36

def self.optionals
  %w[
    payee_preferred
    standard_entry_class_code
  ]
end