/// <summary> /// Call the Loyalty API CloverConnector.SetCustomerInfo with a simple CustomerInfo object assembled from parameters /// </summary> private void SendCustomerInfoMessage(string name, string phone, string welcome, string id, string points) { // create a customer object with a first name and sample home phone number - in real life this would be looked up in a customer data source Customer customer = new Customer { firstName = name, phoneNumbers = new List <PhoneNumber>() { new PhoneNumber { id = "home", phoneNumber = phone } } }; // create the customer info request object with some canned offers SetCustomerInfoRequest request = new SetCustomerInfoRequest { customer = customer, displayString = welcome, externalId = id, extras = { ["POINTS"] = points, ["OFFERS"] = SampleOffer.OfferList( "5_PCT", "5% off this order", "MUG", "Free Branded Coffee Mug", "FRIEND", "Giftcard for Sharing") } }; // Custom Activity data, not part of the Clover API, can be anything serializable to json and understood by a custom activity Data.CloverConnector.SetCustomerInfo(request); }
public void SetCustomerInfo(SetCustomerInfoRequest request) { if (websocket != null) { SetCustomerInfoRequestMessage msg = new SetCustomerInfoRequestMessage(); msg.payload = request; websocket.Send(JsonUtils.Serialize(msg)); } }
public void SetCustomerInfo(SetCustomerInfoRequest request) { Send("/SetCustomerInfo", request); }
public override Task <Empty> SetCustomerInfo(SetCustomerInfoRequest request, ServerCallContext context) { Program.WriteLine("SetCustomerInfo"); Connector.SetCustomerInfo(Translate.From(request)); return(Task.FromResult(new Empty())); }