api discount and change tax
This commit is contained in:
@@ -23,9 +23,10 @@ class Api::CustomersController < Api::ApiController
|
||||
|
||||
def get_customer_by_account
|
||||
account_no = params[:account_no]
|
||||
group_type = params[:group_type] || 'food_court'
|
||||
|
||||
unless @customer = Customer.find_by(paypar_account_no: account_no)
|
||||
response = Customer.search_paypar_account_no(account_no)
|
||||
response = Customer.search_paypar_account_no(account_no)
|
||||
if response["status"] == true
|
||||
@customer = Customer.create({
|
||||
name: response["customer_data"]["name"],
|
||||
@@ -39,8 +40,10 @@ class Api::CustomersController < Api::ApiController
|
||||
membership_id: response["customer_data"]["id"],
|
||||
membership_type: response["customer_data"]["member_group_id"],
|
||||
customer_type: "Dinein",
|
||||
tax_profiles: ["1", "2"],
|
||||
tax_profiles: TaxProfile.where(group_type: group_type).pluck(:id),
|
||||
})
|
||||
else
|
||||
@message = response["message"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user