Click or drag to resize

LoyaltyClientUpdateCard Method

Update a Card Detail, from the submitted values.

Remarks
  • Card Number cannot be changed
  • Card Access Code can be changed. If the Access Code is the default password, this method will not update the password.
Syntax
C#
public Result UpdateCard(
	ManagementGroupRequestOfCard request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfCard

Return Value

Type: Result
Examples
C#
using (var svc = new LoyaltyService.LoyaltyClient())
{
  LoyaltyService.ManagementGroupRequestOfCard request = new LoyaltyService.ManagementGroupRequestOfCard();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  //Populate the properties you wish to modify, undefined properties will not be updated.
  var card = new LoyaltyService.Card();
  card.RSN = new Guid("c8efd8cf-813c-446a-9e47-fd280e82d308");; //Required - RSN of card
  card.CardNumber = "Card number";//Required
  card.CardName = "John Doe";//Optional
  card.AccessCode = "Access code";//Optional
  card.CardStatus = "ACTIVE"; //Optional - Can be one of 'ACTIVE', 'INACTIVE', 'CLOSED', 'LOST', 'STOLEN' or 'PEDNINGACTIVATION'
  card.CardType = "STANDARD"; //Optional - Can be one of 'STANDARD', 'VIRTUAL' or 'INSTORE'
  card.BatchControlRSN = Guid.Empty; //Optional - RSN of the batch. Only used if this card was generated as part of a batch
  card.CardPrintBatchControlRSN = Guid.Empty; //Optional - RSN of the print batch
  //all other card properties ignored

  //add card to request
  request.Value = card;//Required

  LoyaltyService.Result result = svc.UpdateCard(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also