Class: PaypalServerSdk::SupplementaryPurchaseData

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

Overview

The capture identification-related fields. Includes the invoice ID, custom ID, note to payer, and soft descriptor.

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, note_to_payer: SKIP) ⇒ SupplementaryPurchaseData

Returns a new instance of SupplementaryPurchaseData.



45
46
47
48
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 45

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

Instance Attribute Details

#invoice_idString

The API caller-provided external invoice number for this order. Appears in both the payer’s transaction history and the emails that the payer receives.

Returns:

  • (String)


17
18
19
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 17

def invoice_id
  @invoice_id
end

#note_to_payerString

An informational note about this settlement. Appears in both the payer’s transaction history and the emails that the payer receives.

Returns:

  • (String)


22
23
24
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 22

def note_to_payer
  @note_to_payer
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 51

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP
  note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP

  # Create object from extracted values.
  SupplementaryPurchaseData.new(invoice_id: invoice_id,
                                note_to_payer: note_to_payer)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 25

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

.nullablesObject

An array for nullable fields



41
42
43
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 41

def self.nullables
  []
end

.optionalsObject

An array for optional fields



33
34
35
36
37
38
# File 'lib/paypal_server_sdk/models/supplementary_purchase_data.rb', line 33

def self.optionals
  %w[
    invoice_id
    note_to_payer
  ]
end