Class: ActiveMerchant::Billing::Integrations::Chronopay::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Chronopay::Notification
- Defined in:
- lib/active_merchant/billing/integrations/chronopay/notification.rb
Instance Attribute Summary
Attributes inherited from Notification
Instance Method Summary collapse
- #acknowledge ⇒ 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, #valid_sender?
Constructor Details
This class inherits a constructor from ActiveMerchant::Billing::Integrations::Notification
Instance Method Details
#acknowledge ⇒ Object
151 152 153 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 151 def acknowledge true end |
#city ⇒ Object
The customer’s city
98 99 100 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 98 def city params['city'] end |
#complete? ⇒ Boolean
6 7 8 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 6 def complete? status == 'Completed' end |
#country ⇒ Object
The customer’s country - 3 digit country code
93 94 95 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 93 def country params['country'] end |
#currency ⇒ Object
The currency the purchase was made in
138 139 140 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 138 def currency params['currency'] end |
#custom2 ⇒ Object
Additional parameter
128 129 130 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 128 def custom2 params['cs2'] end |
#custom3 ⇒ Object
Additional parameter
133 134 135 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 133 def custom3 params['cs3'] end |
#customer_id ⇒ Object
Unique ID of customer
42 43 44 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 42 def customer_id params['customer_id'] end |
#date ⇒ Object
Date of transaction in MM/DD/YYYY format
68 69 70 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 68 def date params['date'] end |
#email ⇒ Object
The customer’s email address
83 84 85 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 83 def email params['email'] end |
#gross ⇒ Object
the money amount we received in X.2 decimal.
143 144 145 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 143 def gross params['total'] end |
#item_id ⇒ Object
The item id passed in the first custom parameter
123 124 125 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 123 def item_id params['cs1'] end |
#language ⇒ Object
Language
57 58 59 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 57 def language params['language'] end |
#name ⇒ Object
The customer’s full name
78 79 80 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 78 def name params['name'] end |
#password ⇒ Object
Customer’s password for restricted access zone of Merchant’s Web-site, as chosen
118 119 120 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 118 def password params['password'] end |
#product_id ⇒ Object
ID of a product that was purchased
52 53 54 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 52 def product_id params['product_id'] end |
#received_at ⇒ Object
61 62 63 64 65 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 61 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
47 48 49 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 47 def site_id params['site_id'] end |
#state ⇒ Object
The customer’s state. Only useful for US Customers
108 109 110 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 108 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
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 23 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
88 89 90 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 88 def street params['street'] end |
#test? ⇒ Boolean
147 148 149 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 147 def test? date.blank? && time.blank? && transaction_id.blank? end |
#time ⇒ Object
Time of transaction in HH:MM:SS format
73 74 75 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 73 def time params['time'] end |
#transaction_id ⇒ Object
Unique ID of transaction
37 38 39 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 37 def transaction_id params['transaction_id'] end |
#username ⇒ Object
Customer’s login for restricted access zone of Merchant’s Web-site
113 114 115 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 113 def username params['username'] end |
#zip ⇒ Object
The customer’s zip
103 104 105 |
# File 'lib/active_merchant/billing/integrations/chronopay/notification.rb', line 103 def zip params['zip'] end |