Class: OnlinePayments::SDK::Domain::CreateMandateRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#aliasString

Returns the current value of alias.

Returns:

  • (String)

    the current value of alias



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def alias
  @alias
end

#customerOnlinePayments::SDK::Domain::MandateCustomer

Returns the current value of customer.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def customer
  @customer
end

#customer_referenceString

Returns the current value of customer_reference.

Returns:

  • (String)

    the current value of customer_reference



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def customer_reference
  @customer_reference
end

#languageString

Returns the current value of language.

Returns:

  • (String)

    the current value of language



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def language
  @language
end

#recurrence_typeString

Returns the current value of recurrence_type.

Returns:

  • (String)

    the current value of recurrence_type



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def recurrence_type
  @recurrence_type
end

#return_urlString

Returns the current value of return_url.

Returns:

  • (String)

    the current value of return_url



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def return_url
  @return_url
end

#signature_typeString

Returns the current value of signature_type.

Returns:

  • (String)

    the current value of signature_type



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def signature_type
  @signature_type
end

#unique_mandate_referenceString

Returns the current value of unique_mandate_reference.

Returns:

  • (String)

    the current value of unique_mandate_reference



18
19
20
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 18

def unique_mandate_reference
  @unique_mandate_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 42

def from_hash(hash)
  super
  @alias = hash['alias'] if hash.key? 'alias'
  if hash.key? 'customer'
    raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash
    @customer = OnlinePayments::SDK::Domain::MandateCustomer.new_from_hash(hash['customer'])
  end
  @customer_reference = hash['customerReference'] if hash.key? 'customerReference'
  @language = hash['language'] if hash.key? 'language'
  @recurrence_type = hash['recurrenceType'] if hash.key? 'recurrenceType'
  @return_url = hash['returnUrl'] if hash.key? 'returnUrl'
  @signature_type = hash['signatureType'] if hash.key? 'signatureType'
  @unique_mandate_reference = hash['uniqueMandateReference'] if hash.key? 'uniqueMandateReference'
end

#to_hHash

Returns:

  • (Hash)


29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/onlinepayments/sdk/domain/create_mandate_request.rb', line 29

def to_h
  hash = super
  hash['alias'] = @alias unless @alias.nil?
  hash['customer'] = @customer.to_h if @customer
  hash['customerReference'] = @customer_reference unless @customer_reference.nil?
  hash['language'] = @language unless @language.nil?
  hash['recurrenceType'] = @recurrence_type unless @recurrence_type.nil?
  hash['returnUrl'] = @return_url unless @return_url.nil?
  hash['signatureType'] = @signature_type unless @signature_type.nil?
  hash['uniqueMandateReference'] = @unique_mandate_reference unless @unique_mandate_reference.nil?
  hash
end