Class: SixSaferpay::SixSecureData::Update

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_header: nil, update_alias: nil, update_payment_means: nil) ⇒ Update

Returns a new instance of Update.



10
11
12
13
14
15
16
17
# File 'lib/six_saferpay/api/six_secure_card_data/requests/update.rb', line 10

def initialize(request_header: nil,
               update_alias: nil,
               update_payment_means: nil
              )
  @request_header = request_header || SixSaferpay::RequestHeader.new()
  @update_alias = SixSaferpay::UpdateAlias.new(**update_alias.to_h) if update_alias
  @update_payment_means = SixSaferpay::UpdatePaymentMeans.new(**update_payment_means.to_h) if update_payment_means
end

Instance Attribute Details

#request_headerObject

Returns the value of attribute request_header.



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

def request_header
  @request_header
end

#update_aliasObject

Returns the value of attribute update_alias.



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

def update_alias
  @update_alias
end

#update_payment_meansObject

Returns the value of attribute update_payment_means.



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

def update_payment_means
  @update_payment_means
end

Instance Method Details

#response_classObject



36
37
38
# File 'lib/six_saferpay/api/six_secure_card_data/requests/update.rb', line 36

def response_class
  SixSaferpay::SixSecureData::UpdateResponse
end

#to_hashObject Also known as: to_h



19
20
21
22
23
24
25
# File 'lib/six_saferpay/api/six_secure_card_data/requests/update.rb', line 19

def to_hash
  hash = Hash.new
  hash.merge!(request_header: @request_header.to_h) if @request_header
  hash.merge!(update_alias: @update_alias.to_h) if @update_alias
  hash.merge!(update_payment_means: @update_payment_means.to_h) if @update_payment_means
  hash
end

#to_jsonObject



28
29
30
# File 'lib/six_saferpay/api/six_secure_card_data/requests/update.rb', line 28

def to_json
  to_hash.to_json
end

#urlObject



32
33
34
# File 'lib/six_saferpay/api/six_secure_card_data/requests/update.rb', line 32

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