Class: OnlinePayments::SDK::Domain::CreatePaymentRequest

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/create_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputOnlinePayments::SDK::Domain::CardPaymentMethodSpecificInput

Returns the current value of card_payment_method_specific_input.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

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



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def encrypted_customer_input
  @encrypted_customer_input
end

#fraud_fieldsOnlinePayments::SDK::Domain::FraudFields

Returns the current value of fraud_fields.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def fraud_fields
  @fraud_fields
end

#hosted_tokenization_idString

Returns the current value of hosted_tokenization_id.

Returns:

  • (String)

    the current value of hosted_tokenization_id



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def hosted_tokenization_id
  @hosted_tokenization_id
end

#mobile_payment_method_specific_inputOnlinePayments::SDK::Domain::MobilePaymentMethodSpecificInput

Returns the current value of mobile_payment_method_specific_input.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def mobile_payment_method_specific_input
  @mobile_payment_method_specific_input
end

#orderOnlinePayments::SDK::Domain::Order

Returns the current value of order.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def order
  @order
end

#page_customizationOnlinePayments::SDK::Domain::PageCustomization

Returns the current value of page_customization.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def page_customization
  @page_customization
end

#redirect_payment_method_specific_inputOnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificInput

Returns the current value of redirect_payment_method_specific_input.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def redirect_payment_method_specific_input
  @redirect_payment_method_specific_input
end

#sepa_direct_debit_payment_method_specific_inputOnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificInput

Returns the current value of sepa_direct_debit_payment_method_specific_input.

Returns:



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def sepa_direct_debit_payment_method_specific_input
  @sepa_direct_debit_payment_method_specific_input
end

#session_timeoutInteger

Returns the current value of session_timeout.

Returns:

  • (Integer)

    the current value of session_timeout



26
27
28
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 26

def session_timeout
  @session_timeout
end

Instance Method Details

#from_hash(hash) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 54

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 = OnlinePayments::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 = OnlinePayments::SDK::Domain::FraudFields.new_from_hash(hash['fraudFields'])
  end
  @hosted_tokenization_id = hash['hostedTokenizationId'] if hash.key? 'hostedTokenizationId'
  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 = OnlinePayments::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 = OnlinePayments::SDK::Domain::Order.new_from_hash(hash['order'])
  end
  if hash.key? 'pageCustomization'
    raise TypeError, "value '%s' is not a Hash" % [hash['pageCustomization']] unless hash['pageCustomization'].is_a? Hash
    @page_customization = OnlinePayments::SDK::Domain::PageCustomization.new_from_hash(hash['pageCustomization'])
  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 = OnlinePayments::SDK::Domain::RedirectPaymentMethodSpecificInput.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
  end
  if hash.key? 'sepaDirectDebitPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificInput']] unless hash['sepaDirectDebitPaymentMethodSpecificInput'].is_a? Hash
    @sepa_direct_debit_payment_method_specific_input = OnlinePayments::SDK::Domain::SepaDirectDebitPaymentMethodSpecificInput.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
  end
  @session_timeout = hash['sessionTimeout'] if hash.key? 'sessionTimeout'
end

#to_hHash

Returns:

  • (Hash)


39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/onlinepayments/sdk/domain/create_payment_request.rb', line 39

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['hostedTokenizationId'] = @hosted_tokenization_id unless @hosted_tokenization_id.nil?
  hash['mobilePaymentMethodSpecificInput'] = @mobile_payment_method_specific_input.to_h if @mobile_payment_method_specific_input
  hash['order'] = @order.to_h if @order
  hash['pageCustomization'] = @page_customization.to_h if @page_customization
  hash['redirectPaymentMethodSpecificInput'] = @redirect_payment_method_specific_input.to_h if @redirect_payment_method_specific_input
  hash['sepaDirectDebitPaymentMethodSpecificInput'] = @sepa_direct_debit_payment_method_specific_input.to_h if @sepa_direct_debit_payment_method_specific_input
  hash['sessionTimeout'] = @session_timeout unless @session_timeout.nil?
  hash
end