class OffsitePayments::Integrations::Chronopay::Notification

Public Instance Methods

acknowledge(authcode = nil) click to toggle source
# File lib/offsite_payments/integrations/chronopay.rb, line 274
def acknowledge(authcode = nil)
  true
end
city() click to toggle source

The customer’s city

# File lib/offsite_payments/integrations/chronopay.rb, line 221
def city
  params['city']
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/chronopay.rb, line 129
def complete?
  status == 'Completed'
end
country() click to toggle source

The customer’s country - 3 digit country code

# File lib/offsite_payments/integrations/chronopay.rb, line 216
def country
  params['country']
end
currency() click to toggle source

The currency the purchase was made in

# File lib/offsite_payments/integrations/chronopay.rb, line 261
def currency
  params['currency']
end
custom2() click to toggle source

Additional parameter

# File lib/offsite_payments/integrations/chronopay.rb, line 251
def custom2
  params['cs2']
end
custom3() click to toggle source

Additional parameter

# File lib/offsite_payments/integrations/chronopay.rb, line 256
def custom3
  params['cs3']
end
customer_id() click to toggle source

Unique ID of customer

# File lib/offsite_payments/integrations/chronopay.rb, line 165
def customer_id
  params['customer_id']
end
date() click to toggle source

Date of transaction in MM/DD/YYYY format

# File lib/offsite_payments/integrations/chronopay.rb, line 191
def date
  params['date']
end
email() click to toggle source

The customer’s email address

# File lib/offsite_payments/integrations/chronopay.rb, line 206
def email
  params['email']
end
gross() click to toggle source

the money amount we received in X.2 decimal.

# File lib/offsite_payments/integrations/chronopay.rb, line 266
def gross
  params['total']
end
item_id() click to toggle source

The item id passed in the first custom parameter

# File lib/offsite_payments/integrations/chronopay.rb, line 246
def item_id
  params['cs1']
end
language() click to toggle source

Language

# File lib/offsite_payments/integrations/chronopay.rb, line 180
def language
  params['language']
end
name() click to toggle source

The customer’s full name

# File lib/offsite_payments/integrations/chronopay.rb, line 201
def name
  params['name']
end
password() click to toggle source

Customer’s password for restricted access zone of Merchant’s Web-site, as chosen

# File lib/offsite_payments/integrations/chronopay.rb, line 241
def password
  params['password']
end
product_id() click to toggle source

ID of a product that was purchased

# File lib/offsite_payments/integrations/chronopay.rb, line 175
def product_id
  params['product_id']
end
received_at() click to toggle source
# 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() click to toggle source

Unique ID of Merchant’s web-site

# File lib/offsite_payments/integrations/chronopay.rb, line 170
def site_id
  params['site_id']
end
state() click to toggle source

The customer’s state. Only useful for US Customers

# File lib/offsite_payments/integrations/chronopay.rb, line 231
def state
  params['state']
end
status() click to toggle source

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

# 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() click to toggle source

The customer’s street address

# File lib/offsite_payments/integrations/chronopay.rb, line 211
def street
  params['street']
end
test?() click to toggle source
# File lib/offsite_payments/integrations/chronopay.rb, line 270
def test?
  date.blank? && time.blank? && transaction_id.blank?
end
time() click to toggle source

Time of transaction in HH:MM:SS format

# File lib/offsite_payments/integrations/chronopay.rb, line 196
def time
  params['time']
end
transaction_id() click to toggle source

Unique ID of transaction

# File lib/offsite_payments/integrations/chronopay.rb, line 160
def transaction_id
  params['transaction_id']
end
username() click to toggle source

Customer’s login for restricted access zone of Merchant’s Web-site

# File lib/offsite_payments/integrations/chronopay.rb, line 236
def username
  params['username']
end
zip() click to toggle source

The customer’s zip

# File lib/offsite_payments/integrations/chronopay.rb, line 226
def zip
  params['zip']
end