Class: PaypalServerSdk::NetworkTransactionReference

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

Overview

Reference values used by the card network to identify a transaction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id:, date: SKIP, network: SKIP, acquirer_reference_number: SKIP) ⇒ NetworkTransactionReference

Returns a new instance of NetworkTransactionReference.



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

def initialize(id:, date: SKIP, network: SKIP,
               acquirer_reference_number: SKIP)
  @id = id
  @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_numberString

Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.

Returns:

  • (String)


35
36
37
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 35

def acquirer_reference_number
  @acquirer_reference_number
end

#dateString

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.

Returns:

  • (String)


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

def date
  @date
end

#idString

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 -.

Returns:

  • (String)


19
20
21
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 19

def id
  @id
end

#networkCardBrand

The card network or brand. Applies to credit, debit, gift, and payment cards.

Returns:



30
31
32
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 30

def network
  @network
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  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.
  NetworkTransactionReference.new(id: id,
                                  date: date,
                                  network: network,
                                  acquirer_reference_number: acquirer_reference_number)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 38

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

.nullablesObject

An array for nullable fields



57
58
59
# File 'lib/paypal_server_sdk/models/network_transaction_reference.rb', line 57

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    date
    network
    acquirer_reference_number
  ]
end