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 def acknowledge payload = raw response = ssl_post(EPaymentPlans.notification_confirmation_url, payload) # Replace with the appropriate codes raise StandardError.new("Faulty EPaymentPlans result: #{response}") unless ["AUTHORISED", "DECLINED"].include?(response) response == "AUTHORISED" end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 9 def complete? status == "Completed" end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 30 def currency params['currency'] end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 26 def gross params['gross'] end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 17 def item_id params['item_id'] end
When was this payment received by the client.
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 22 def received_at Time.parse(params['received_at'].to_s).utc end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 34 def security_key params['security_key'] end
# File lib/active_merchant/billing/integrations/e_payment_plans/notification.rb, line 43 def status params['status'].capitalize end
Generated with the Darkfish Rdoc Generator 2.