Class: MerbMerchant::Billing::Integrations::Chronopay::Notification
- Inherits:
-
Notification
- Object
- Notification
- MerbMerchant::Billing::Integrations::Chronopay::Notification
- Defined in:
- lib/merb_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 MerbMerchant::Billing::Integrations::Notification
Instance Method Details
#acknowledge ⇒ Object
149 150 151 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 149 def acknowledge true end |
#city ⇒ Object
The customer’s city
96 97 98 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 96 def city params['city'] end |
#complete? ⇒ Boolean
6 7 8 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 6 def complete? status == 'Completed' end |
#country ⇒ Object
The customer’s country - 3 digit country code
91 92 93 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 91 def country params['country'] end |
#currency ⇒ Object
The currency the purchase was made in
136 137 138 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 136 def currency params['currency'] end |
#custom2 ⇒ Object
Additional parameter
126 127 128 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 126 def custom2 params['cs2'] end |
#custom3 ⇒ Object
Additional parameter
131 132 133 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 131 def custom3 params['cs3'] end |
#customer_id ⇒ Object
Unique ID of customer
42 43 44 |
# File 'lib/merb_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
66 67 68 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 66 def date params['date'] end |
#email ⇒ Object
The customer’s email address
81 82 83 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 81 def email params['email'] end |
#gross ⇒ Object
the money amount we received in X.2 decimal.
141 142 143 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 141 def gross params['total'] end |
#item_id ⇒ Object
The item id passed in the first custom parameter
121 122 123 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 121 def item_id params['cs1'] end |
#language ⇒ Object
Language
57 58 59 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 57 def language params['language'] end |
#name ⇒ Object
The customer’s full name
76 77 78 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 76 def name params['name'] end |
#password ⇒ Object
Customer’s password for restricted access zone of Merchant’s Web-site, as chosen
116 117 118 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 116 def password params['password'] end |
#product_id ⇒ Object
ID of a product that was purchased
52 53 54 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 52 def product_id params['product_id'] end |
#received_at ⇒ Object
61 62 63 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 61 def received_at Time.parse("#{date} #{time}") unless date.blank? || time.blank? end |
#site_id ⇒ Object
Unique ID of Merchant’s web-site
47 48 49 |
# File 'lib/merb_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
106 107 108 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 106 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/merb_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
86 87 88 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 86 def street params['street'] end |
#test? ⇒ Boolean
145 146 147 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 145 def test? date.blank? && time.blank? && transaction_id.blank? end |
#time ⇒ Object
Time of transaction in HH:MM:SS format
71 72 73 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 71 def time params['time'] end |
#transaction_id ⇒ Object
Unique ID of transaction
37 38 39 |
# File 'lib/merb_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
111 112 113 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 111 def username params['username'] end |
#zip ⇒ Object
The customer’s zip
101 102 103 |
# File 'lib/merb_merchant/billing/integrations/chronopay/notification.rb', line 101 def zip params['zip'] end |