Class: PaysecureApiDocumentationLive::Success36Exception

Inherits:
APIException
  • Object
show all
Defined in:
lib/paysecure_api_documentation_live/exceptions/success36_exception.rb

Overview

Success36 class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ Success36Exception

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpReponse of the API call.



83
84
85
86
87
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 83

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#amount_variabilityString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 58

def amount_variability
  @amount_variability
end

#customer_idString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 46

def customer_id
  @customer_id
end

#emailString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 38

def email
  @email
end

#end_dateString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 66

def end_date
  @end_date
end

#frequencyString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 18

def frequency
  @frequency
end

#mandate_idString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 50

def mandate_id
  @mandate_id
end

#mandate_max_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


54
55
56
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 54

def mandate_max_amount
  @mandate_max_amount
end

#next_mandate_dateInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 42

def next_mandate_date
  @next_mandate_date
end

#pause_end_dateString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 74

def pause_end_date
  @pause_end_date
end

#pause_start_dateString

TODO: Write general description for this method

Returns:

  • (String)


70
71
72
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 70

def pause_start_date
  @pause_start_date
end

#recurring_mandate_idsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


34
35
36
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 34

def recurring_mandate_ids
  @recurring_mandate_ids
end

#ruleString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 22

def rule
  @rule
end

#session_idString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 78

def session_id
  @session_id
end

#start_dateString

TODO: Write general description for this method

Returns:

  • (String)


62
63
64
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 62

def start_date
  @start_date
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 14

def status
  @status
end

#total_deducted_amountString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 30

def total_deducted_amount
  @total_deducted_amount
end

#valueInteger

TODO: Write general description for this method

Returns:

  • (Integer)


26
27
28
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 26

def value
  @value
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 134

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, frequency: #{@frequency.inspect}, rule:"\
  " #{@rule.inspect}, value: #{@value.inspect}, total_deducted_amount:"\
  " #{@total_deducted_amount.inspect}, recurring_mandate_ids:"\
  " #{@recurring_mandate_ids.inspect}, email: #{@email.inspect}, next_mandate_date:"\
  " #{@next_mandate_date.inspect}, customer_id: #{@customer_id.inspect}, mandate_id:"\
  " #{@mandate_id.inspect}, mandate_max_amount: #{@mandate_max_amount.inspect},"\
  " amount_variability: #{@amount_variability.inspect}, start_date: #{@start_date.inspect},"\
  " end_date: #{@end_date.inspect}, pause_start_date: #{@pause_start_date.inspect},"\
  " pause_end_date: #{@pause_end_date.inspect}, session_id: #{@session_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
128
129
130
131
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, frequency: #{@frequency}, rule: #{@rule}, value:"\
  " #{@value}, total_deducted_amount: #{@total_deducted_amount}, recurring_mandate_ids:"\
  " #{@recurring_mandate_ids}, email: #{@email}, next_mandate_date: #{@next_mandate_date},"\
  " customer_id: #{@customer_id}, mandate_id: #{@mandate_id}, mandate_max_amount:"\
  " #{@mandate_max_amount}, amount_variability: #{@amount_variability}, start_date:"\
  " #{@start_date}, end_date: #{@end_date}, pause_start_date: #{@pause_start_date},"\
  " pause_end_date: #{@pause_end_date}, session_id: #{@session_id}>"
end

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • hash (Hash)

    The deserialized response sent by the server in the



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/paysecure_api_documentation_live/exceptions/success36_exception.rb', line 92

def unbox(hash)
  return nil unless hash

  @status = hash.key?('status') ? hash['status'] : nil
  @frequency = hash.key?('frequency') ? hash['frequency'] : nil
  @rule = hash.key?('rule') ? hash['rule'] : nil
  @value = hash.key?('value') ? hash['value'] : nil
  @total_deducted_amount =
    hash.key?('totalDeductedAmount') ? hash['totalDeductedAmount'] : nil
  @recurring_mandate_ids =
    hash.key?('recurringMandateIds') ? hash['recurringMandateIds'] : nil
  @email = hash.key?('email') ? hash['email'] : nil
  @next_mandate_date =
    hash.key?('nextMandateDate') ? hash['nextMandateDate'] : nil
  @customer_id = hash.key?('customer_id') ? hash['customer_id'] : nil
  @mandate_id = hash.key?('mandate_id') ? hash['mandate_id'] : nil
  @mandate_max_amount =
    hash.key?('mandate_max_amount') ? hash['mandate_max_amount'] : nil
  @amount_variability =
    hash.key?('amount_variability') ? hash['amount_variability'] : nil
  @start_date = hash.key?('start_date') ? hash['start_date'] : nil
  @end_date = hash.key?('end_date') ? hash['end_date'] : nil
  @pause_start_date =
    hash.key?('pause_start_date') ? hash['pause_start_date'] : nil
  @pause_end_date =
    hash.key?('pause_end_date') ? hash['pause_end_date'] : nil
  @session_id = hash.key?('session_id') ? hash['session_id'] : nil
end