Class: SixSaferpay::SixSecurePayGateOffer::CreateOffer
- Inherits:
-
Object
- Object
- SixSaferpay::SixSecurePayGateOffer::CreateOffer
- Defined in:
- lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb
Instance Attribute Summary collapse
-
#billing_address_form ⇒ Object
Returns the value of attribute billing_address_form.
-
#config_set ⇒ Object
Returns the value of attribute config_set.
-
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
-
#payer ⇒ Object
Returns the value of attribute payer.
-
#payment ⇒ Object
Returns the value of attribute payment.
Instance Method Summary collapse
-
#initialize(payment:, expiration_date:, config_set: nil, payer:, billing_address_form: nil, register_alias: nil) ⇒ CreateOffer
constructor
A new instance of CreateOffer.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(payment:, expiration_date:, config_set: nil, payer:, billing_address_form: nil, register_alias: nil) ⇒ CreateOffer
Returns a new instance of CreateOffer.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 13 def initialize(payment: , expiration_date: , config_set: nil, payer: , billing_address_form: nil, register_alias: nil ) @payment = SixSaferpay::Payment.new(**payment.to_h) if payment @expiration_date = expiration_date @config_set = config_set @payer = SixSaferpay::Payer.new(**payer.to_h) if payer @billing_address_form = SixSaferpay::BillingAddressForm.new(**billing_address_form) if billing_address_form @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias end |
Instance Attribute Details
#billing_address_form ⇒ Object
Returns the value of attribute billing_address_form.
5 6 7 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 5 def billing_address_form @billing_address_form end |
#config_set ⇒ Object
Returns the value of attribute config_set.
5 6 7 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 5 def config_set @config_set end |
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
5 6 7 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 5 def expiration_date @expiration_date end |
#payer ⇒ Object
Returns the value of attribute payer.
5 6 7 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 5 def payer @payer end |
#payment ⇒ Object
Returns the value of attribute payment.
5 6 7 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 5 def payment @payment end |
Instance Method Details
#response_class ⇒ Object
50 51 52 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 50 def response_class SixSaferpay::SixSecurePayGateOffer::CreateOfferResponse end |
#to_hash ⇒ Object Also known as: to_h
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 30 def to_hash hash = Hash.new hash.merge!(payment: @payment.to_h) if @payment hash.merge!(expiration_date: @expiration_date) if @expiration_date hash.merge!(config_set: @config_set) if @config_set hash.merge!(payer: @payer.to_h) if @payer hash.merge!(billing_address_form: @billing_address_form.to_h) if @billing_address_form hash.merge!(register_alias: @register_alias.to_h) if @register_alias hash end |
#to_json ⇒ Object
42 43 44 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 42 def to_json to_hash.to_json end |
#url ⇒ Object
46 47 48 |
# File 'lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb', line 46 def url "/rest/customers/#{customer_id}/terminals/#{terminal_id}/spg-offers" end |