Class: InitResponse
- Inherits:
-
Object
- Object
- InitResponse
- Defined in:
- lib/paynow_sdk.rb
Constant Summary collapse
- @@success =
true
- @@instructions =
""
- @@has_redirect =
true
- @@hash =
""
- @@redirect_url =
""
- @@error =
""
- @@poll_url =
""
Class Method Summary collapse
- .error ⇒ Object
- .error=(val) ⇒ Object
- .has_redirect ⇒ Object
- .has_redirect=(val) ⇒ Object
- .hash ⇒ Object
- .hash=(val) ⇒ Object
- .instructions ⇒ Object
- .instructions=(val) ⇒ Object
- .poll_url ⇒ Object
- .poll_url=(val) ⇒ Object
- .redirect_url ⇒ Object
- .redirect_url=(val) ⇒ Object
- .success ⇒ Object
- .success=(val) ⇒ Object
Instance Method Summary collapse
- #error ⇒ Object
- #error=(val) ⇒ Object
- #has_redirect ⇒ Object
- #has_redirect=(val) ⇒ Object
- #hash ⇒ Object
- #hash=(val) ⇒ Object
-
#initialize(data) ⇒ InitResponse
constructor
A new instance of InitResponse.
- #instructions ⇒ Object
- #instructions=(val) ⇒ Object
- #poll_url ⇒ Object
- #poll_url=(val) ⇒ Object
- #redirect_url ⇒ Object
- #redirect_url=(val) ⇒ Object
- #success ⇒ Object
- #success=(val) ⇒ Object
Constructor Details
#initialize(data) ⇒ InitResponse
Returns a new instance of InitResponse.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/paynow_sdk.rb', line 113 def initialize(data) @status = data["status"] @success = data["status"].downcase != "error" @has_redirect = data.include?("browserurl") @hash = data.include?("hash") if @success @poll_url = data["pollurl"] end if !@success @error = data["error"] end if @has_redirect @redirect_url = data["browserurl"] end if data.include?("instructions") @instruction = data["instructions"] end end |
Class Method Details
.error ⇒ Object
162 |
# File 'lib/paynow_sdk.rb', line 162 def self.error; @@error; end |
.error=(val) ⇒ Object
163 |
# File 'lib/paynow_sdk.rb', line 163 def self.error=(val); @@error = val; end |
.has_redirect ⇒ Object
144 |
# File 'lib/paynow_sdk.rb', line 144 def self.has_redirect; @@has_redirect; end |
.has_redirect=(val) ⇒ Object
145 |
# File 'lib/paynow_sdk.rb', line 145 def self.has_redirect=(val); @@has_redirect = val; end |
.hash ⇒ Object
150 |
# File 'lib/paynow_sdk.rb', line 150 def self.hash; @@hash; end |
.hash=(val) ⇒ Object
151 |
# File 'lib/paynow_sdk.rb', line 151 def self.hash=(val); @@hash = val; end |
.instructions ⇒ Object
138 |
# File 'lib/paynow_sdk.rb', line 138 def self.instructions; @@instructions; end |
.instructions=(val) ⇒ Object
139 |
# File 'lib/paynow_sdk.rb', line 139 def self.instructions=(val); @@instructions = val; end |
.poll_url ⇒ Object
168 |
# File 'lib/paynow_sdk.rb', line 168 def self.poll_url; @@poll_url; end |
.poll_url=(val) ⇒ Object
169 |
# File 'lib/paynow_sdk.rb', line 169 def self.poll_url=(val); @@poll_url = val; end |
.redirect_url ⇒ Object
156 |
# File 'lib/paynow_sdk.rb', line 156 def self.redirect_url; @@redirect_url; end |
.redirect_url=(val) ⇒ Object
157 |
# File 'lib/paynow_sdk.rb', line 157 def self.redirect_url=(val); @@redirect_url = val; end |
.success ⇒ Object
132 |
# File 'lib/paynow_sdk.rb', line 132 def self.success; @@success; end |
.success=(val) ⇒ Object
133 |
# File 'lib/paynow_sdk.rb', line 133 def self.success=(val); @@success = val; end |
Instance Method Details
#error ⇒ Object
165 |
# File 'lib/paynow_sdk.rb', line 165 def error; @error = @@error if @error.nil?; @error; end |
#error=(val) ⇒ Object
166 |
# File 'lib/paynow_sdk.rb', line 166 def error=(val); @error = val; end |
#has_redirect ⇒ Object
147 |
# File 'lib/paynow_sdk.rb', line 147 def has_redirect; @has_redirect = @@has_redirect if @has_redirect.nil?; @has_redirect; end |
#has_redirect=(val) ⇒ Object
148 |
# File 'lib/paynow_sdk.rb', line 148 def has_redirect=(val); @has_redirect = val; end |
#hash ⇒ Object
153 |
# File 'lib/paynow_sdk.rb', line 153 def hash; @hash = @@hash if @hash.nil?; @hash; end |
#hash=(val) ⇒ Object
154 |
# File 'lib/paynow_sdk.rb', line 154 def hash=(val); @hash = val; end |
#instructions ⇒ Object
141 |
# File 'lib/paynow_sdk.rb', line 141 def instructions; @instructions = @@instructions if @instructions.nil?; @instructions; end |
#instructions=(val) ⇒ Object
142 |
# File 'lib/paynow_sdk.rb', line 142 def instructions=(val); @instructions = val; end |
#poll_url ⇒ Object
171 |
# File 'lib/paynow_sdk.rb', line 171 def poll_url; @poll_url = @@poll_url if @poll_url.nil?; @poll_url; end |
#poll_url=(val) ⇒ Object
172 |
# File 'lib/paynow_sdk.rb', line 172 def poll_url=(val); @poll_url = val; end |
#redirect_url ⇒ Object
159 |
# File 'lib/paynow_sdk.rb', line 159 def redirect_url; @redirect_url = @@redirect_url if @redirect_url.nil?; @redirect_url; end |
#redirect_url=(val) ⇒ Object
160 |
# File 'lib/paynow_sdk.rb', line 160 def redirect_url=(val); @redirect_url = val; end |
#success ⇒ Object
135 |
# File 'lib/paynow_sdk.rb', line 135 def success; @success = @@success if @success.nil?; @success; end |
#success=(val) ⇒ Object
136 |
# File 'lib/paynow_sdk.rb', line 136 def success=(val); @success = val; end |