PointOfSaleClientLinkMemberToInStoreCard Method |
Assign an existing Physical Card to an existing Member. The Card Status is set to "ACTIVE.
public ResultOfInstoreCard LinkMemberToInStoreCard( RequestOfLinkInstoreCardMember request )
using (var svc = new PointOfSaleService.PointOfSaleClient()) { var request = new PointOfSaleService.RequestOfLinkInstoreCardMember(); request.Token = "Token";//Required - Token returned from PointOfSaleService.Authenticate var linkInstoreCardMember = new PointOfSaleService.LinkInstoreCardMember(); //Required //Note: card status must be set to 'PENDINGACTIVATION' linkInstoreCardMember.CardNumber = "Card number"; //Required linkInstoreCardMember.AccessCode = "Access code"; //Required - May be optional depending on configuration linkInstoreCardMember.CardMergeNotActiveCard_TemplateID = "CARDMERGENOTACTIVECARD_TEMPLATEID"; //Optional - If specified sends an email to the member using the specified template linkInstoreCardMember.SendEmail = true; //Optional - Sends welcome email to member if true and member not already in program var programMembership = new PointOfSaleService.ProgramMembership(); programMembership.MemberRSN = new Guid("3435a914-958f-4ba8-9474-facaab26cc6f");;//Required - RSN of member programMembership.StartDate = DateTime.Now; //Optional programMembership.EndDate = DateTime.Now.AddYears(1); //Optional (leave blank or set to DateTime.Min to have a program membership that does not expire) //programMembership.DisplayValue should not be supplied //programMembership.RSN should not be supplied //programMembership.PersonRSN should not be supplied //programMembership.ProgramRSN should not be supplied //set member program membership linkInstoreCardMember.ProgramMembership = programMembership; //add linkInstoreCardMember to request request.Value = linkInstoreCardMember; PointOfSaleService.ResultOfInstoreCard result = svc.LinkMemberToInStoreCard(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }