Class: SixSaferpay::SixTransaction::Capture
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::Capture
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/capture.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#billpay ⇒ Object
Returns the value of attribute billpay.
-
#marketplace ⇒ Object
Returns the value of attribute marketplace.
-
#mastercard_issuer_installments ⇒ Object
Returns the value of attribute mastercard_issuer_installments.
-
#pending_notification ⇒ Object
Returns the value of attribute pending_notification.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#transaction_reference ⇒ Object
Returns the value of attribute transaction_reference.
Instance Method Summary collapse
-
#initialize(request_header: nil, transaction_reference:, amount: nil, billpay: nil, pending_notification: nil, marketplace: nil, mastercard_issuer_installments: nil) ⇒ Capture
constructor
A new instance of Capture.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, transaction_reference:, amount: nil, billpay: nil, pending_notification: nil, marketplace: nil, mastercard_issuer_installments: nil) ⇒ Capture
Returns a new instance of Capture.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# 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 |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def amount @amount end |
#billpay ⇒ Object
Returns the value of attribute billpay.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def billpay @billpay end |
#marketplace ⇒ Object
Returns the value of attribute marketplace.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def marketplace @marketplace end |
#mastercard_issuer_installments ⇒ Object
Returns the value of attribute mastercard_issuer_installments.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def mastercard_issuer_installments @mastercard_issuer_installments end |
#pending_notification ⇒ Object
Returns the value of attribute pending_notification.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def pending_notification @pending_notification end |
#request_header ⇒ Object
Returns the value of attribute request_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def request_header @request_header end |
#transaction_reference ⇒ Object
Returns the value of attribute transaction_reference.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 5 def transaction_reference @transaction_reference end |
Instance Method Details
#response_class ⇒ Object
58 59 60 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 58 def response_class SixSaferpay::SixTransaction::CaptureResponse end |
#to_hash ⇒ Object Also known as: to_h
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# 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 |
#to_json ⇒ Object
50 51 52 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 50 def to_json to_hash.to_json end |
#url ⇒ Object
54 55 56 |
# File 'lib/six_saferpay/api/six_transaction/requests/capture.rb', line 54 def url '/Payment/v1/Transaction/Capture' end |