class Origami::OthersPaymentsController < BaseOrigamiController
  def index
  	@membership_rebate_balance = 0
  	@sale_id = params[:sale_id]
  	@cashier_type   = params[:type]
  	path = request.fullpath
  	if path.include? ("credit_payment")
  		@payment_method_setting = PaymentMethodSetting.where("LOWER(payment_method) in ('mpu','visa','master','jcb','unionpay','alipay') and is_active='1'")
  	else
  		@payment_method_setting = PaymentMethodSetting.all
  	end

  	@rebate = MembershipSetting.find_by_rebate(1)
  	@sale_data = Sale.find_by_sale_id(@sale_id)
  	# @sale_id = params[:sale_id]
  	# sale_data = Sale.find_by_sale_id(@sale_id)

 #  	if sale_data.customer_id
 #  		customer_data= Customer.find_by_customer_id(sale_data.customer_id)
	#   	@membership_id = customer_data.membership_id
	#   	if !@membership_id.nil?
	#   		membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
	# 	  	membership_data = SalePayment.get_paypar_account(membership_setting.gateway_url,membership_setting.auth_token,@membership_id)
	# 	  	if membership_data["status"]==true
	# 	  		membership_account_data = membership_data["data"];
	# 	  		membership_account_data.each do |acc_data|
	# 	  			if acc_data["accountable_type"] == "REBATEACCOUNT"
	# 	  				@membership_rebate_balance=acc_data["balance"]
	# 	  			else
	# 	  				@membership_rebate_balance = 0
	# 	  			end
	# 	  		end
	# 	  	else
	# 	  		@membership_rebate_balance = 0
	# 	  	end
	# 	end
	# else

 #  	end
  end

  def create
  end

end
