Class: PaypalServerSdk::BlikOneClickPaymentRequest

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

Overview

Information used to pay using BLIK one-click flow.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(consumer_reference:, auth_code: SKIP, alias_label: SKIP, alias_key: SKIP) ⇒ BlikOneClickPaymentRequest

Returns a new instance of BlikOneClickPaymentRequest.



56
57
58
59
60
61
62
# File 'lib/paypal_server_sdk/models/blik_one_click_payment_request.rb', line 56

def initialize(consumer_reference:, auth_code: SKIP, alias_label: SKIP,
               alias_key: SKIP)
  @auth_code = auth_code unless auth_code == SKIP
  @consumer_reference = consumer_reference
  @alias_label = alias_label unless alias_label == SKIP
  @alias_key = alias_key unless alias_key == SKIP
end

Instance Attribute Details

#alias_keyString

A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given merchant. Used only in conjunction with a Consumer Reference.

Returns:

  • (String)


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

def alias_key
  @alias_key
end

#alias_labelString

A bank defined identifier used as a display name to allow the payer to differentiate between multiple registered bank accounts.

Returns:

  • (String)


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

def alias_label
  @alias_label
end

#auth_codeString

The 6-digit code used to authenticate a consumer within BLIK.

Returns:

  • (String)


14
15
16
# File 'lib/paypal_server_sdk/models/blik_one_click_payment_request.rb', line 14

def auth_code
  @auth_code
end

#consumer_referenceString

The merchant generated, unique reference serving as a primary identifier for accounts connected between Blik and a merchant.

Returns:

  • (String)


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

def consumer_reference
  @consumer_reference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/paypal_server_sdk/models/blik_one_click_payment_request.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  consumer_reference =
    hash.key?('consumer_reference') ? hash['consumer_reference'] : nil
  auth_code = hash.key?('auth_code') ? hash['auth_code'] : SKIP
  alias_label = hash.key?('alias_label') ? hash['alias_label'] : SKIP
  alias_key = hash.key?('alias_key') ? hash['alias_key'] : SKIP

  # Create object from extracted values.
  BlikOneClickPaymentRequest.new(consumer_reference: consumer_reference,
                                 auth_code: auth_code,
                                 alias_label: alias_label,
                                 alias_key: alias_key)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth_code'] = 'auth_code'
  @_hash['consumer_reference'] = 'consumer_reference'
  @_hash['alias_label'] = 'alias_label'
  @_hash['alias_key'] = 'alias_key'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/paypal_server_sdk/models/blik_one_click_payment_request.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
# File 'lib/paypal_server_sdk/models/blik_one_click_payment_request.rb', line 43

def self.optionals
  %w[
    auth_code
    alias_label
    alias_key
  ]
end