Class: ActiveMerchant::Billing::Integrations::Adyen::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Adyen::Notification
show all
- Defined in:
- lib/active_merchant/billing/integrations/adyen/notification.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross_cents, #initialize, #valid_sender?
Instance Method Details
#acknowledge ⇒ Object
Acknowledge the transaction to Adyen. This method has to be called after a new apc arrives. Adyen will verify that all the information we received are correct and will return a ok or a fail.
Example:
def ipn
notify = AdyenNotification.new(request.raw_post)
if notify.acknowledge
... process order ... if notify.complete?
else
... log possible hacking attempt ...
end
73
74
75
76
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 73
def acknowledge
true
end
|
#complete? ⇒ Boolean
8
9
10
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 8
def complete?
((params['eventCode'] == 'AUTHORISATION') and (params['success'] == 'true'))
end
|
#currency ⇒ Object
55
56
57
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 55
def currency
params['currency']
end
|
#event_code ⇒ Object
12
13
14
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 12
def event_code
params['eventCode']
end
|
#gross ⇒ Object
the money amount we received in X.2 decimal.
42
43
44
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 42
def gross
params['value']
end
|
#item_id ⇒ Object
16
17
18
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 16
def item_id
params['merchantReference']
end
|
#payer_email ⇒ Object
29
30
31
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 29
def payer_email
''end
|
#received_at ⇒ Object
When was this payment received by the client.
25
26
27
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 25
def received_at
params['eventDate']
end
|
#receiver_email ⇒ Object
33
34
35
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 33
def receiver_email
''end
|
#security_key ⇒ Object
37
38
39
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 37
def security_key
''end
|
#status ⇒ Object
51
52
53
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 51
def status
params['success']
end
|
#test? ⇒ Boolean
Was this a test transaction?
47
48
49
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 47
def test?
params['live'] == 'false'
end
|
#transaction_id ⇒ Object
20
21
22
|
# File 'lib/active_merchant/billing/integrations/adyen/notification.rb', line 20
def transaction_id
params['pspReference']
end
|