<commit_before>class WebhooksController < ApplicationController
# En Rails 4 suprime el mensaje: "WARNING: Can't verify CSRF token authenticity" añadiendo:
  skip_before_filter
  protect_from_forgery :except => :receptor
  require 'json'
  require 'yajl/json_gem'

  def receptor
    request.body.rewind  # in case someone already read it
    event_json = JSON.parse(request.body.read)

    reference_id = event_json['data']['object']['reference_id']
    description = event_json['data']['object']['description']
    amount = event_json['data']['object']['amount'].to_i
    amount = number_to_currency amount
    currency = event_json['data']['object']['currency']
    @order =  Order.find_by_number(reference_id)

    if event_json['data']['object']['status'] == 'paid'
      @order.create_conekta_invoice(nil, @order.credited_total)
      Notifier.order_complete(@order, reference_id, description, amount, currency).deliver
    end
    Notifier.order_complete(@order, reference_id, description, amount, currency).deliver
    msg = { :status => "200"}
    render json: msg
  end
end<commit_msg>Prueba para envio de mail, una vez que ya se pago el articulo<commit_after>class WebhooksController < ApplicationController
# En Rails 4 suprime el mensaje: "WARNING: Can't verify CSRF token authenticity" añadiendo:
  skip_before_filter
  protect_from_forgery :except => :receptor
  require 'json'
  require 'yajl/json_gem'

  def receptor
    request.body.rewind  # in case someone already read it
    event_json = JSON.parse(request.body.read)

    reference_id = event_json['data']['object']['reference_id']
    description = event_json['data']['object']['description']
    amount = event_json['data']['object']['amount'].to_i
    currency = event_json['data']['object']['currency']
    @order =  Order.find_by_number(reference_id)

    if event_json['data']['object']['status'] == 'paid'
      @order.create_conekta_invoice(nil, @order.credited_total)
      Notifier.order_complete(@order, reference_id, description, amount, currency).deliver
    end
    Notifier.order_complete(@order, reference_id, description, amount, currency).deliver
    msg = { :status => "200"}
    render json: msg
  end
end
{'fraction_non_alphanumeric': 0.12551159618008187, 'fraction_numerical': 0.0036380172805820826, 'mean_word_length': 4.994550408719346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '115017', 'n_tokens_mistral': 671, 'n_tokens_neox': 651, 'n_words': 152}