Class: PaypalServerSdk::ApplePayDecryptedTokenData

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

Overview

Information about the Payment data obtained by decrypting Apple Pay token.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(tokenized_card:, transaction_amount: SKIP, device_manufacturer_id: SKIP, payment_data_type: SKIP, payment_data: SKIP) ⇒ ApplePayDecryptedTokenData

Returns a new instance of ApplePayDecryptedTokenData.



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

def initialize(tokenized_card:, transaction_amount: SKIP,
               device_manufacturer_id: SKIP, payment_data_type: SKIP,
               payment_data: SKIP)
  @transaction_amount = transaction_amount unless transaction_amount == SKIP
  @tokenized_card = tokenized_card
  @device_manufacturer_id = device_manufacturer_id unless device_manufacturer_id == SKIP
  @payment_data_type = payment_data_type unless payment_data_type == SKIP
  @payment_data = payment_data unless payment_data == SKIP
end

Instance Attribute Details

#device_manufacturer_idString

Apple Pay Hex-encoded device manufacturer identifier. The pattern is defined by an external party and supports Unicode.

Returns:

  • (String)


24
25
26
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 24

def device_manufacturer_id
  @device_manufacturer_id
end

#payment_dataApplePayPaymentData

Information about the decrypted apple pay payment data for the token like cryptogram, eci indicator.

Returns:



34
35
36
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 34

def payment_data
  @payment_data
end

#payment_data_typeApplePayPaymentDataType

Indicates the type of payment data passed, in case of Non China the payment data is 3DSECURE and for China it is EMV.



29
30
31
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 29

def payment_data_type
  @payment_data_type
end

#tokenized_cardApplePayTokenizedCard

The payment card to use to fund a payment. Can be a credit or debit card.



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

def tokenized_card
  @tokenized_card
end

#transaction_amountMoney

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

Returns:



15
16
17
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 15

def transaction_amount
  @transaction_amount
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
89
90
91
92
93
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  tokenized_card = ApplePayTokenizedCard.from_hash(hash['tokenized_card']) if
    hash['tokenized_card']
  transaction_amount = Money.from_hash(hash['transaction_amount']) if
    hash['transaction_amount']
  device_manufacturer_id =
    hash.key?('device_manufacturer_id') ? hash['device_manufacturer_id'] : SKIP
  payment_data_type =
    hash.key?('payment_data_type') ? hash['payment_data_type'] : SKIP
  payment_data = ApplePayPaymentData.from_hash(hash['payment_data']) if hash['payment_data']

  # Create object from extracted values.
  ApplePayDecryptedTokenData.new(tokenized_card: tokenized_card,
                                 transaction_amount: transaction_amount,
                                 device_manufacturer_id: device_manufacturer_id,
                                 payment_data_type: payment_data_type,
                                 payment_data: payment_data)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['transaction_amount'] = 'transaction_amount'
  @_hash['tokenized_card'] = 'tokenized_card'
  @_hash['device_manufacturer_id'] = 'device_manufacturer_id'
  @_hash['payment_data_type'] = 'payment_data_type'
  @_hash['payment_data'] = 'payment_data'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/paypal_server_sdk/models/apple_pay_decrypted_token_data.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    transaction_amount
    device_manufacturer_id
    payment_data_type
    payment_data
  ]
end