class Redsys::NotificationsController

Public Instance Methods

notification() click to toggle source

Tratamiento para la notificación online

  • Ds_Response == “0000” => Transacción correcta

# File lib/generators/templates/controllers/notifications_controller.rb, line 9
def notification
  json_params = JSON.parse(Base64.strict_decode64(params[:Ds_MerchantParameters]))
  if json_params["Ds_Response"].present? && json_params["Ds_Response"] == "0000"
    status = :ok
  else
    status = :bad_request
  end
  render nothing: true, layout: false, status: status
end