class Api::Payment::CallbackController < Api::ApiController

	skip_before_action  :authenticate

  def kbzpay
    Rails.logger.info params[:Request]
    callback_value = params[:Request]
    trade_status = params[:Request][:trade_status]
    total_amount = params[:Request][:total_amount]
    if trade_status == "PAY_SUCCESS"
      merch_order_id = params[:Request][:merch_order_id]
      
      status, filename, sale_receipt_no, printer_name = Payment.pay(getCloudDomain, cash, sale_id, member_info, type, tax_type, path, latest_order_no, current_shop, current_user, 'kbzpay', merch_order_id)
      render json: JSON.generate({:status => status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name})
    end
  end

end
