Class: SixSaferpay::SixTransaction::MultipartCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_header: nil, transaction_reference:, amount: nil, type:, order_part_id:, marketplace: nil) ⇒ MultipartCapture

Returns a new instance of MultipartCapture.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 14

def initialize(request_header: nil,
               transaction_reference:,
               amount: nil,
               type:,
               order_part_id:,
               marketplace: nil
              )
  @request_header = request_header || SixSaferpay::RequestHeader.new()
  @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
  @amount = SixSaferpay::Amount.new(**amount.to_h) if amount
  @type = type
  @order_part_id = order_part_id
  @marketplace = SixSaferpay::Marketplace.new(**marketplace.to_h) if marketplace
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def amount
  @amount
end

#marketplaceObject

Returns the value of attribute marketplace.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def marketplace
  @marketplace
end

#order_part_idObject

Returns the value of attribute order_part_id.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def order_part_id
  @order_part_id
end

#request_headerObject

Returns the value of attribute request_header.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def request_header
  @request_header
end

#transaction_referenceObject

Returns the value of attribute transaction_reference.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def transaction_reference
  @transaction_reference
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 5

def type
  @type
end

Instance Method Details

#response_classObject



49
50
51
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 49

def response_class
  SixSaferpay::SixTransaction::MultipartCaptureResponse
end

#to_hashObject Also known as: to_h



29
30
31
32
33
34
35
36
37
38
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 29

def to_hash
  hash = Hash.new
  hash.merge!(request_header: @request_header.to_h) if @request_header
  hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
  hash.merge!(amount: @amount.to_h) if @amount
  hash.merge!(type: @type) if @type
  hash.merge!(order_part_id: @order_part_id) if @order_part_id
  hash.merge!(marketplace: @marketplace.to_h) if @marketplace
  hash
end

#to_jsonObject



41
42
43
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 41

def to_json
  to_hash.to_json
end

#urlObject



45
46
47
# File 'lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb', line 45

def url
  '/Payment/v1/Transaction/MultipartCapture'
end