Class: OffsitePayments::Integrations::Ipay88::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::Ipay88::Notification
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
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?
Instance Method Details
#account ⇒ Object
159
160
161
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 159
def account
params["MerchantCode"]
end
|
#acknowledge ⇒ Object
195
196
197
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 195
def acknowledge
secure? && (!success? || requery == "00")
end
|
#auth_code ⇒ Object
175
176
177
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 175
def auth_code
params["AuthCode"]
end
|
#complete? ⇒ Boolean
143
144
145
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 143
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
155
156
157
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 155
def currency
params["Currency"]
end
|
#error ⇒ Object
179
180
181
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 179
def error
params["ErrDesc"]
end
|
#gross ⇒ Object
151
152
153
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 151
def gross
params["Amount"].try(:gsub, /,(?=\d{3}\b)/, '')
end
|
#item_id ⇒ Object
147
148
149
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 147
def item_id
params["RefNo"]
end
|
#payment ⇒ Object
163
164
165
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 163
def payment
params["PaymentId"].to_i
end
|
167
168
169
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 167
def
params["Remark"]
end
|
#secure? ⇒ Boolean
187
188
189
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 187
def secure?
generated_signature == signature
end
|
#signature ⇒ Object
183
184
185
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 183
def signature
params["Signature"]
end
|
#status ⇒ Object
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
191
192
193
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 191
def success?
status == 'Completed'
end
|
#transaction_id ⇒ Object
171
172
173
|
# File 'lib/offsite_payments/integrations/ipay88.rb', line 171
def transaction_id
params["TransId"]
end
|