Class: PaypalServerSdk::Level2CardProcessingData

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

Overview

The level 2 card processing data collections. If your merchant account has been configured for Level 2 processing this field will be passed to the processor on your behalf. Please contact your PayPal Technical Account Manager to define level 2 data for your business.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(invoice_id: SKIP, tax_total: SKIP) ⇒ Level2CardProcessingData

Returns a new instance of Level2CardProcessingData.



48
49
50
51
# File 'lib/paypal_server_sdk/models/level2_card_processing_data.rb', line 48

def initialize(invoice_id: SKIP, tax_total: SKIP)
  @invoice_id = invoice_id unless invoice_id == SKIP
  @tax_total = tax_total unless tax_total == SKIP
end

Instance Attribute Details

#invoice_idString

Use this field to pass a purchase identification value of up to 127 ASCII characters. The length of this field will be adjusted to meet network specifications (25chars for Visa and Mastercard, 17chars for Amex), and the original invoice ID will still be displayed in your existing reports.

Returns:

  • (String)


20
21
22
# File 'lib/paypal_server_sdk/models/level2_card_processing_data.rb', line 20

def invoice_id
  @invoice_id
end

#tax_totalMoney

The currency and amount for a financial transaction, such as a balance or payment due.

Returns:



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

def tax_total
  @tax_total
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/paypal_server_sdk/models/level2_card_processing_data.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
  tax_total = Money.from_hash(hash['tax_total']) if hash['tax_total']

  # Create object from extracted values.
  Level2CardProcessingData.new(invoice_id: invoice_id,
                               tax_total: tax_total)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/paypal_server_sdk/models/level2_card_processing_data.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/level2_card_processing_data.rb', line 36

def self.optionals
  %w[
    invoice_id
    tax_total
  ]
end