class Origami::CardPaymentsController < BaseOrigamiController


  def index
  	@membership_rebate_balance = 0
  	@membership_id = 0
  	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

  end

  def create
  end

end
