Class: PaypalServerSdk::NetworkTransaction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::NetworkTransaction
- Defined in:
- lib/paypal_server_sdk/models/network_transaction.rb
Overview
Reference values used by the card network to identify a transaction.
Instance Attribute Summary collapse
-
#acquirer_reference_number ⇒ String
Reference ID issued for the card transaction.
-
#date ⇒ String
The date that the transaction was authorized by the scheme.
-
#id ⇒ String
Transaction reference id returned by the scheme.
-
#network ⇒ CardBrand
The card network or brand.
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(id: SKIP, date: SKIP, network: SKIP, acquirer_reference_number: SKIP) ⇒ NetworkTransaction
constructor
A new instance of NetworkTransaction.
-
#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(id: SKIP, date: SKIP, network: SKIP, acquirer_reference_number: SKIP) ⇒ NetworkTransaction
Returns a new instance of NetworkTransaction.
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 64 def initialize(id: SKIP, date: SKIP, network: SKIP, acquirer_reference_number: SKIP) @id = id unless id == SKIP @date = date unless date == SKIP @network = network unless network == SKIP unless acquirer_reference_number == SKIP @acquirer_reference_number = acquirer_reference_number end end |
Instance Attribute Details
#acquirer_reference_number ⇒ String
Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.
37 38 39 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 37 def acquirer_reference_number @acquirer_reference_number end |
#date ⇒ String
The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as “BankNet reference date”. For some specific networks, such as MasterCard and Discover, this date field is mandatory when the ‘previous_network_transaction_reference_id` is passed.
27 28 29 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 27 def date @date end |
#id ⇒ String
Transaction reference id returned by the scheme. For Visa and Amex, this is the “Tran id” field in response. For MasterCard, this is the “BankNet reference id” field in response. For Discover, this is the “NRID” field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.
19 20 21 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 19 def id @id end |
#network ⇒ CardBrand
The card network or brand. Applies to credit, debit, gift, and payment cards.
32 33 34 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 32 def network @network end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP date = hash.key?('date') ? hash['date'] : SKIP network = hash.key?('network') ? hash['network'] : SKIP acquirer_reference_number = hash.key?('acquirer_reference_number') ? hash['acquirer_reference_number'] : SKIP # Create object from extracted values. NetworkTransaction.new(id: id, date: date, network: network, acquirer_reference_number: acquirer_reference_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['date'] = 'date' @_hash['network'] = 'network' @_hash['acquirer_reference_number'] = 'acquirer_reference_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
60 61 62 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 60 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 50 def self.optionals %w[ id date network acquirer_reference_number ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, date: #{@date.inspect}, network: #{@network.inspect},"\ " acquirer_reference_number: #{@acquirer_reference_number.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/paypal_server_sdk/models/network_transaction.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, date: #{@date}, network: #{@network},"\ " acquirer_reference_number: #{@acquirer_reference_number}>" end |