Class: Ingenico::Direct::SDK::Domain::CreatePaymentRequest

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/create_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputIngenico::Direct::SDK::Domain::CardPaymentMethodSpecificInput

Returns the current value of card_payment_method_specific_input.

Returns:



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#encrypted_customer_inputString

Returns the current value of encrypted_customer_input.

Returns:

  • (String)

    the current value of encrypted_customer_input



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def encrypted_customer_input
  @encrypted_customer_input
end

#fraud_fieldsIngenico::Direct::SDK::Domain::FraudFields

Returns the current value of fraud_fields.

Returns:



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def fraud_fields
  @fraud_fields
end

#mobile_payment_method_specific_inputIngenico::Direct::SDK::Domain::MobilePaymentMethodSpecificInput

Returns the current value of mobile_payment_method_specific_input.

Returns:



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def mobile_payment_method_specific_input
  @mobile_payment_method_specific_input
end

#orderIngenico::Direct::SDK::Domain::Order

Returns the current value of order.

Returns:



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def order
  @order
end

#redirect_payment_method_specific_inputIngenico::Direct::SDK::Domain::RedirectPaymentMethodSpecificInput

Returns the current value of redirect_payment_method_specific_input.

Returns:



21
22
23
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 21

def redirect_payment_method_specific_input
  @redirect_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 41

def from_hash(hash)
  super
  if hash.key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificInput.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  @encrypted_customer_input = hash['encryptedCustomerInput'] if hash.key? 'encryptedCustomerInput'
  if hash.key? 'fraudFields'
    raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']] unless hash['fraudFields'].is_a? Hash
    @fraud_fields = Ingenico::Direct::SDK::Domain::FraudFields.new_from_hash(hash['fraudFields'])
  end
  if hash.key? 'mobilePaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificInput']] unless hash['mobilePaymentMethodSpecificInput'].is_a? Hash
    @mobile_payment_method_specific_input = Ingenico::Direct::SDK::Domain::MobilePaymentMethodSpecificInput.new_from_hash(hash['mobilePaymentMethodSpecificInput'])
  end
  if hash.key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = Ingenico::Direct::SDK::Domain::Order.new_from_hash(hash['order'])
  end
  if hash.key? 'redirectPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificInput']] unless hash['redirectPaymentMethodSpecificInput'].is_a? Hash
    @redirect_payment_method_specific_input = Ingenico::Direct::SDK::Domain::RedirectPaymentMethodSpecificInput.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
  end
end

#to_hHash

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
38
39
# File 'lib/ingenico/direct/sdk/domain/create_payment_request.rb', line 30

def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h if @card_payment_method_specific_input
  hash['encryptedCustomerInput'] = @encrypted_customer_input unless @encrypted_customer_input.nil?
  hash['fraudFields'] = @fraud_fields.to_h if @fraud_fields
  hash['mobilePaymentMethodSpecificInput'] = @mobile_payment_method_specific_input.to_h if @mobile_payment_method_specific_input
  hash['order'] = @order.to_h if @order
  hash['redirectPaymentMethodSpecificInput'] = @redirect_payment_method_specific_input.to_h if @redirect_payment_method_specific_input
  hash
end