class SixSaferpay::SixTransaction::Capture

Attributes

amount[RW]
billpay[RW]
marketplace[RW]
mastercard_issuer_installments[RW]
pending_notification[RW]
request_header[RW]
transaction_reference[RW]

Public Class Methods

new(request_header: nil, transaction_reference:, amount: nil, billpay: nil, pending_notification: nil, marketplace: nil, mastercard_issuer_installments: nil ) click to toggle source
# File lib/six_saferpay/api/six_transaction/requests/capture.rb, line 15
def initialize(request_header: nil,
               transaction_reference:,
               amount: nil,
               billpay: nil,
               pending_notification: nil,
               marketplace: nil,
              mastercard_issuer_installments: 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
  @billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
  @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
  @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
  if mastercard_issuer_installments
    @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
      .new(mastercard_issuer_installments.to_h)
  end
end

Public Instance Methods

response_class() click to toggle source
# File lib/six_saferpay/api/six_transaction/requests/capture.rb, line 58
def response_class
  SixSaferpay::SixTransaction::CaptureResponse
end
to_h()
Alias for: to_hash
to_hash() click to toggle source
# File lib/six_saferpay/api/six_transaction/requests/capture.rb, line 35
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!(billpay: @billpay.to_h) if @billpay
  hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
  hash.merge!(marketplace: @marketplace.to_h) if @marketplace
  if @mastercard_issuer_installments
    hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
  end
  hash
end
Also aliased as: to_h
to_json() click to toggle source
# File lib/six_saferpay/api/six_transaction/requests/capture.rb, line 50
def to_json
  to_hash.to_json
end
url() click to toggle source
# File lib/six_saferpay/api/six_transaction/requests/capture.rb, line 54
def url
  '/Payment/v1/Transaction/Capture'
end