Class: SixSaferpay::SixSecureData::Insert

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_secure_card_data/requests/insert.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_header: nil, register_alias:, type:, return_urls:, styling: nil, language_code: nil, check: nil, payment_methods: nil, card_form: nil, payment_means: nil) ⇒ Insert

Returns a new instance of Insert.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 17

def initialize(request_header: nil,
               register_alias:,
               type:,
               return_urls:,
               styling: nil,
               language_code: nil,
               check: nil,
               payment_methods: nil,
               card_form: nil,
               payment_means: nil
              )
  @request_header = request_header || SixSaferpay::RequestHeader.new()
  @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias
  @type = type
  @return_urls = SixSaferpay::ReturnUrls.new(**return_urls.to_h) if return_urls
  @styling = SixSaferpay::Styling.new(**styling.to_h) if styling
  @language_code = language_code
  @check = SixSaferpay::Check.new(**check.to_h) if check
  @payment_methods = payment_methods
  @card_form = SixSaferpay::CardForm.new(**card_form.to_h) if card_form
  @payment_means = SixSaferpay::RequestPaymentMeans.new(**payment_means.to_h) if payment_means
end

Instance Attribute Details

#card_formObject

Returns the value of attribute card_form.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def card_form
  @card_form
end

#checkObject

Returns the value of attribute check.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def check
  @check
end

#language_codeObject

Returns the value of attribute language_code.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def language_code
  @language_code
end

#payment_meansObject

Returns the value of attribute payment_means.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def payment_means
  @payment_means
end

#payment_methodsObject

Returns the value of attribute payment_methods.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def payment_methods
  @payment_methods
end

#register_aliasObject

Returns the value of attribute register_alias.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def register_alias
  @register_alias
end

#request_headerObject

Returns the value of attribute request_header.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def request_header
  @request_header
end

#return_urlsObject

Returns the value of attribute return_urls.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def return_urls
  @return_urls
end

#stylingObject

Returns the value of attribute styling.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def styling
  @styling
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 5

def type
  @type
end

Instance Method Details

#response_classObject



64
65
66
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 64

def response_class
  SixSaferpay::SixSecureData::InsertResponse
end

#to_hashObject Also known as: to_h



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 40

def to_hash
  hash = Hash.new
  hash.merge!(request_header: @request_header.to_h) if @request_header
  hash.merge!(register_alias: @register_alias.to_h) if @register_alias
  hash.merge!(type: @type) if @type
  hash.merge!(return_urls: @return_urls.to_h) if @return_urls
  hash.merge!(styling: @styling.to_h) if @styling
  hash.merge!(language_code: @language_code) if @language_code
  hash.merge!(check: @check.to_h) if @check
  hash.merge!(payment_methods: @payment_methods) if @payment_methods
  hash.merge!(card_form: @card_form.to_h) if @card_form
  hash.merge!(payment_means: @payment_means.to_h) if @payment_means
  hash
end

#to_jsonObject



56
57
58
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 56

def to_json
  to_hash.to_json
end

#urlObject



60
61
62
# File 'lib/six_saferpay/api/six_secure_card_data/requests/insert.rb', line 60

def url
  '/Payment/v1/Alias/Insert'
end