update sale and customer
This commit is contained in:
@@ -51,34 +51,14 @@ class Crm::CustomersController < BaseCrmController
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(params[:id])
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
if(response["status"] == true)
|
||||
@membership = response["data"]
|
||||
else
|
||||
@membership = 0
|
||||
end
|
||||
# @type = "-"
|
||||
# @balance = 0.00
|
||||
# response["data"].each do |res|
|
||||
# if res["accountable_type"] == "RebateAccount"
|
||||
# @balance = res["balance"]
|
||||
# @type = "RebateAccount"
|
||||
# end
|
||||
# end
|
||||
|
||||
|
||||
#end customer amount
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user