Class: InitResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ InitResponse

Returns a new instance of InitResponse.


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/paynow_sdk.rb', line 111

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

.errorObject


160
# File 'lib/paynow_sdk.rb', line 160

def self.error; @@error; end

.error=(val) ⇒ Object


161
# File 'lib/paynow_sdk.rb', line 161

def self.error=(val); @@error = val; end

.has_redirectObject


142
# File 'lib/paynow_sdk.rb', line 142

def self.has_redirect; @@has_redirect; end

.has_redirect=(val) ⇒ Object


143
# File 'lib/paynow_sdk.rb', line 143

def self.has_redirect=(val); @@has_redirect = val; end

.hashObject


148
# File 'lib/paynow_sdk.rb', line 148

def self.hash; @@hash; end

.hash=(val) ⇒ Object


149
# File 'lib/paynow_sdk.rb', line 149

def self.hash=(val); @@hash = val; end

.instructionsObject


136
# File 'lib/paynow_sdk.rb', line 136

def self.instructions; @@instructions; end

.instructions=(val) ⇒ Object


137
# File 'lib/paynow_sdk.rb', line 137

def self.instructions=(val); @@instructions = val; end

.poll_urlObject


166
# File 'lib/paynow_sdk.rb', line 166

def self.poll_url; @@poll_url; end

.poll_url=(val) ⇒ Object


167
# File 'lib/paynow_sdk.rb', line 167

def self.poll_url=(val); @@poll_url = val; end

.redirect_urlObject


154
# File 'lib/paynow_sdk.rb', line 154

def self.redirect_url; @@redirect_url; end

.redirect_url=(val) ⇒ Object


155
# File 'lib/paynow_sdk.rb', line 155

def self.redirect_url=(val); @@redirect_url = val; end

.successObject


130
# File 'lib/paynow_sdk.rb', line 130

def self.success; @@success; end

.success=(val) ⇒ Object


131
# File 'lib/paynow_sdk.rb', line 131

def self.success=(val); @@success = val; end

Instance Method Details

#errorObject


163
# File 'lib/paynow_sdk.rb', line 163

def error; @error = @@error if @error.nil?; @error; end

#error=(val) ⇒ Object


164
# File 'lib/paynow_sdk.rb', line 164

def error=(val); @error = val; end

#has_redirectObject


145
# File 'lib/paynow_sdk.rb', line 145

def has_redirect; @has_redirect = @@has_redirect if @has_redirect.nil?; @has_redirect; end

#has_redirect=(val) ⇒ Object


146
# File 'lib/paynow_sdk.rb', line 146

def has_redirect=(val); @has_redirect = val; end

#hashObject


151
# File 'lib/paynow_sdk.rb', line 151

def hash; @hash = @@hash if @hash.nil?; @hash; end

#hash=(val) ⇒ Object


152
# File 'lib/paynow_sdk.rb', line 152

def hash=(val); @hash = val; end

#instructionsObject


139
# File 'lib/paynow_sdk.rb', line 139

def instructions; @instructions = @@instructions if @instructions.nil?; @instructions; end

#instructions=(val) ⇒ Object


140
# File 'lib/paynow_sdk.rb', line 140

def instructions=(val); @instructions = val; end

#poll_urlObject


169
# File 'lib/paynow_sdk.rb', line 169

def poll_url; @poll_url = @@poll_url if @poll_url.nil?; @poll_url; end

#poll_url=(val) ⇒ Object


170
# File 'lib/paynow_sdk.rb', line 170

def poll_url=(val); @poll_url = val; end

#redirect_urlObject


157
# File 'lib/paynow_sdk.rb', line 157

def redirect_url; @redirect_url = @@redirect_url if @redirect_url.nil?; @redirect_url; end

#redirect_url=(val) ⇒ Object


158
# File 'lib/paynow_sdk.rb', line 158

def redirect_url=(val); @redirect_url = val; end

#successObject


133
# File 'lib/paynow_sdk.rb', line 133

def success; @success = @@success if @success.nil?; @success; end

#success=(val) ⇒ Object


134
# File 'lib/paynow_sdk.rb', line 134

def success=(val); @success = val; end