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
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 9 9: def complete? 10: status == "Completed" 11: end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 30 30: def currency 31: params['currency'] 32: end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 26 26: def gross 27: params['gross'] 28: end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 17 17: def item_id 18: params['item_id'] 19: end
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
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 34 34: def security_key 35: params['security_key'] 36: end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 43 43: def status 44: params['status'].capitalize 45: end
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.
Generated with the Darkfish Rdoc Generator 1.1.6.