Included Modules

Class Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::EPaymentPlans::Notification

Public Instance Methods

acknowledge() click to toggle source

Acknowledge the transaction to EPaymentPlans. This method has to be called after a new apc arrives. EPaymentPlans will verify that all the information we received are correct and will return ok or a fail.

Example:

  def ipn
    notify = EPaymentPlans.notification(request.raw_post)

    if notify.acknowledge
      ... process order ... if notify.complete?
    else
      ... log possible hacking attempt ...
    end
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 61
61:           def acknowledge
62:             payload = raw
63: 
64:             response = ssl_post(EPaymentPlans.notification_confirmation_url, payload)
65: 
66:             # Replace with the appropriate codes
67:             raise StandardError.new("Faulty EPaymentPlans result: #{response}") unless ["AUTHORISED", "DECLINED"].include?(response)
68:             response == "AUTHORISED"
69:           end
complete?() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 9
 9:           def complete?
10:             status == "Completed"
11:           end
currency() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 30
30:           def currency
31:             params['currency']
32:           end
gross() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 26
26:           def gross
27:             params['gross']
28:           end
item_id() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 17
17:           def item_id
18:             params['item_id']
19:           end
received_at() click to toggle source

When was this payment received by the client.

    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 22
22:           def received_at
23:             Time.parse(params['received_at'].to_s).utc
24:           end
security_key() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 34
34:           def security_key
35:             params['security_key']
36:           end
status() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 43
43:           def status
44:             params['status'].capitalize
45:           end
test?() click to toggle source

Was this a test transaction?

    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 39
39:           def test?
40:             params['test'] == 'test'
41:           end
transaction_id() click to toggle source
    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 13
13:           def transaction_id
14:             params['transaction_id']
15:           end

Private Instance Methods

parse(post) click to toggle source

Take the posted data and move the relevant data into a hash

    # File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 73
73:           def parse(post)
74:             @raw = post
75:             for line in post.split('&')
76:               key, value = *line.scan( %{^(\w+)\=(.*)$} ).flatten
77:               params[key] = value
78:             end
79:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.