Class: OffsitePayments::Integrations::Chronopay::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::Chronopay::Notification
- Defined in:
- lib/offsite_payments/integrations/chronopay.rb
Instance Attribute Summary
Attributes inherited from Notification
Instance Method Summary collapse
- #acknowledge(authcode = nil) ⇒ Object
-
#city ⇒ Object
The customer’s city.
- #complete? ⇒ Boolean
-
#country ⇒ Object
The customer’s country - 3 digit country code.
-
#currency ⇒ Object
The currency the purchase was made in.
-
#custom2 ⇒ Object
Additional parameter.
-
#custom3 ⇒ Object
Additional parameter.
-
#customer_id ⇒ Object
Unique ID of customer.
-
#date ⇒ Object
Date of transaction in MM/DD/YYYY format.
-
#email ⇒ Object
The customer’s email address.
-
#gross ⇒ Object
the money amount we received in X.2 decimal.
-
#item_id ⇒ Object
The item id passed in the first custom parameter.
-
#language ⇒ Object
Language.
-
#name ⇒ Object
The customer’s full name.
-
#password ⇒ Object
Customer’s password for restricted access zone of Merchant’s Web-site, as chosen.
-
#product_id ⇒ Object
ID of a product that was purchased.
- #received_at ⇒ Object
-
#site_id ⇒ Object
Unique ID of Merchant’s web-site.
-
#state ⇒ Object
The customer’s state.
-
#status ⇒ Object
Status of transaction.
-
#street ⇒ Object
The customer’s street address.
- #test? ⇒ Boolean
-
#time ⇒ Object
Time of transaction in HH:MM:SS format.
-
#transaction_id ⇒ Object
Unique ID of transaction.
-
#username ⇒ Object
Customer’s login for restricted access zone of Merchant’s Web-site.
-
#zip ⇒ Object
The customer’s zip.
Methods inherited from Notification
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #valid_sender?
Constructor Details
This class inherits a constructor from OffsitePayments::Notification
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
274 275 276 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 274 def acknowledge(authcode = nil) true end |
#city ⇒ Object
The customer’s city
221 222 223 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 221 def city params['city'] end |
#complete? ⇒ Boolean
129 130 131 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 129 def complete? status == 'Completed' end |
#country ⇒ Object
The customer’s country - 3 digit country code
216 217 218 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 216 def country params['country'] end |
#currency ⇒ Object
The currency the purchase was made in
261 262 263 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 261 def currency params['currency'] end |
#custom2 ⇒ Object
Additional parameter
251 252 253 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 251 def custom2 params['cs2'] end |
#custom3 ⇒ Object
Additional parameter
256 257 258 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 256 def custom3 params['cs3'] end |
#customer_id ⇒ Object
Unique ID of customer
165 166 167 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 165 def customer_id params['customer_id'] end |
#date ⇒ Object
Date of transaction in MM/DD/YYYY format
191 192 193 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 191 def date params['date'] end |
#email ⇒ Object
The customer’s email address
206 207 208 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 206 def email params['email'] end |
#gross ⇒ Object
the money amount we received in X.2 decimal.
266 267 268 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 266 def gross params['total'] end |
#item_id ⇒ Object
The item id passed in the first custom parameter
246 247 248 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 246 def item_id params['cs1'] end |
#language ⇒ Object
Language
180 181 182 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 180 def language params['language'] end |
#name ⇒ Object
The customer’s full name
201 202 203 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 201 def name params['name'] end |
#password ⇒ Object
Customer’s password for restricted access zone of Merchant’s Web-site, as chosen
241 242 243 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 241 def password params['password'] end |
#product_id ⇒ Object
ID of a product that was purchased
175 176 177 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 175 def product_id params['product_id'] end |
#received_at ⇒ Object
184 185 186 187 188 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 184 def received_at # Date should be formatted "dd-mm-yy" to be parsed by 1.8 and 1.9 the same way formatted_date = Date.strptime(date, "%m/%d/%Y").strftime("%d-%m-%Y") Time.parse("#{formatted_date} #{time}") unless date.blank? || time.blank? end |
#site_id ⇒ Object
Unique ID of Merchant’s web-site
170 171 172 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 170 def site_id params['site_id'] end |
#state ⇒ Object
The customer’s state. Only useful for US Customers
231 232 233 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 231 def state params['state'] end |
#status ⇒ Object
Status of transaction. List of possible values:
onetime – one time payment has been made, no repayment required;
initial – first payment has been made, repayment required in corresponding period;
decline – charge request has been rejected;
- <tt>rebill – repayment has been made together with initial transaction;</ttt>
cancel – repayments has been disabled;
expire – customer’s access to restricted zone membership has been expired;
refund – request to refund has been received;
chargeback – request to chargeback has been received.
-
This implementation of Chronopay does not support subscriptions. The status codes used are matched to the status codes that Paypal sends. See Paypal::Notification#status for more details
146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 146 def status case params['transaction_type'] when 'onetime' 'Completed' when 'refund' 'Refunded' when 'chargeback' 'Reversed' else 'Failed' end end |
#street ⇒ Object
The customer’s street address
211 212 213 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 211 def street params['street'] end |
#test? ⇒ Boolean
270 271 272 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 270 def test? date.blank? && time.blank? && transaction_id.blank? end |
#time ⇒ Object
Time of transaction in HH:MM:SS format
196 197 198 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 196 def time params['time'] end |
#transaction_id ⇒ Object
Unique ID of transaction
160 161 162 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 160 def transaction_id params['transaction_id'] end |
#username ⇒ Object
Customer’s login for restricted access zone of Merchant’s Web-site
236 237 238 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 236 def username params['username'] end |
#zip ⇒ Object
The customer’s zip
226 227 228 |
# File 'lib/offsite_payments/integrations/chronopay.rb', line 226 def zip params['zip'] end |