Class: SixSaferpay::SixTransaction::AlternativePayment
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::AlternativePayment
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb
Instance Attribute Summary collapse
-
#notification ⇒ Object
Returns the value of attribute notification.
-
#order ⇒ Object
Returns the value of attribute order.
-
#payer ⇒ Object
Returns the value of attribute payer.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#payment_method_options ⇒ Object
Returns the value of attribute payment_method_options.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#terminal_id ⇒ Object
Returns the value of attribute terminal_id.
Instance Method Summary collapse
-
#initialize(request_header: nil, terminal_id:, payment:, payment_method:, payment_method_options: nil, payer: nil, notification:, order: nil, risk_factors: nil) ⇒ AlternativePayment
constructor
A new instance of AlternativePayment.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, terminal_id:, payment:, payment_method:, payment_method_options: nil, payer: nil, notification:, order: nil, risk_factors: nil) ⇒ AlternativePayment
Returns a new instance of AlternativePayment.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 18 def initialize(request_header: nil, terminal_id:, payment:, payment_method:, payment_method_options: nil, payer: nil, notification:, order: nil, risk_factors: nil ) @request_header = request_header || SixSaferpay::RequestHeader.new() @terminal_id = terminal_id @payment = SixSaferpay::Payment.new(**payment.to_h) @payment_method = payment_method @payment_method_options = SixSaferpay::PaymentMethodOptions.new(**.to_h) if @payer = SixSaferpay::Payer.new(**payer.to_h) if payer @notification = SixSaferpay::Notification.new(**notification.to_h) @order = SixSaferpay::Order.new(**order.to_h) if order @risk_factors = SixSaferpay::RiskFactors.new(**risk_factors.to_h) if risk_factors end |
Instance Attribute Details
#notification ⇒ Object
Returns the value of attribute notification.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def notification @notification end |
#order ⇒ Object
Returns the value of attribute order.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def order @order end |
#payer ⇒ Object
Returns the value of attribute payer.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def payer @payer end |
#payment ⇒ Object
Returns the value of attribute payment.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def payment @payment end |
#payment_method ⇒ Object
Returns the value of attribute payment_method.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def payment_method @payment_method end |
#payment_method_options ⇒ Object
Returns the value of attribute payment_method_options.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def @payment_method_options end |
#request_header ⇒ Object
Returns the value of attribute request_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def request_header @request_header end |
#terminal_id ⇒ Object
Returns the value of attribute terminal_id.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 5 def terminal_id @terminal_id end |
Instance Method Details
#response_class ⇒ Object
62 63 64 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 62 def response_class SixSaferpay::SixTransaction::AlternativePaymentResponse end |
#to_hash ⇒ Object Also known as: to_h
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 39 def to_hash hash = Hash.new hash.merge!(request_header: @request_header.to_h) if @request_header hash.merge!(terminal_id: @terminal_id) hash.merge!(payment: @payment.to_h) hash.merge!(payment_method: @payment_method) hash.merge!(payment_method_options: @payment_method_options.to_h) if @payment_method_options hash.merge!(payer: @payer.to_h) if @payer hash.merge!(notification: @notification.to_h) hash.merge!(order: @order.to_h) if @order hash.merge!(risk_factors: @risk_factors.to_h) if @risk_factors hash end |
#to_json ⇒ Object
54 55 56 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 54 def to_json to_hash.to_json end |
#url ⇒ Object
58 59 60 |
# File 'lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb', line 58 def url '/Payment/v1/Transaction/AlternativePayment' end |