Class: OffsitePayments::Integrations::Ipay88::Notification

Inherits:
Notification
  • Object
show all
Includes:
ActiveUtils::PostsData
Defined in:
lib/offsite_payments/integrations/ipay88.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

#amount, #empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from OffsitePayments::Notification

Instance Method Details

#accountObject



159
160
161
# File 'lib/offsite_payments/integrations/ipay88.rb', line 159

def 
  params["MerchantCode"]
end

#acknowledgeObject



195
196
197
# File 'lib/offsite_payments/integrations/ipay88.rb', line 195

def acknowledge
  secure? && (!success? || requery == "00")
end

#auth_codeObject



175
176
177
# File 'lib/offsite_payments/integrations/ipay88.rb', line 175

def auth_code
  params["AuthCode"]
end

#complete?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/offsite_payments/integrations/ipay88.rb', line 143

def complete?
  status == 'Completed'
end

#currencyObject



155
156
157
# File 'lib/offsite_payments/integrations/ipay88.rb', line 155

def currency
  params["Currency"]
end

#errorObject



179
180
181
# File 'lib/offsite_payments/integrations/ipay88.rb', line 179

def error
  params["ErrDesc"]
end

#grossObject



151
152
153
# File 'lib/offsite_payments/integrations/ipay88.rb', line 151

def gross
  params["Amount"].try(:gsub, /,(?=\d{3}\b)/, '')
end

#item_idObject



147
148
149
# File 'lib/offsite_payments/integrations/ipay88.rb', line 147

def item_id
  params["RefNo"]
end

#paymentObject



163
164
165
# File 'lib/offsite_payments/integrations/ipay88.rb', line 163

def payment
  params["PaymentId"].to_i
end

#remarkObject



167
168
169
# File 'lib/offsite_payments/integrations/ipay88.rb', line 167

def remark
  params["Remark"]
end

#secure?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/offsite_payments/integrations/ipay88.rb', line 187

def secure?
  generated_signature == signature
end

#signatureObject



183
184
185
# File 'lib/offsite_payments/integrations/ipay88.rb', line 183

def signature
  params["Signature"]
end

#statusObject



135
136
137
138
139
140
141
# File 'lib/offsite_payments/integrations/ipay88.rb', line 135

def status
  if params["Status"] == '1'
    'Completed'
  else
    error == CANCELLED_ERROR_DESCRIPTION ? 'Cancelled' : 'Failed'
  end
end

#success?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/offsite_payments/integrations/ipay88.rb', line 191

def success?
  status == 'Completed'
end

#transaction_idObject



171
172
173
# File 'lib/offsite_payments/integrations/ipay88.rb', line 171

def transaction_id
  params["TransId"]
end