Exemple #1
0
        /// <summary>
        /// Update card
        /// </summary>
        /// <param name="card">Card</param>
        /// <returns>Card</returns>
        public Card Update(Card card)
        {
            card.SetRequiredFields(new List <string> {
                GlobalConstants.ProfileId,
                GlobalConstants.Id
            });
            card.CheckRequiredFields();
            card.SetRequiredFields(new List <string> {
            });
            card.SetOptionalFields(new List <string> {
                GlobalConstants.CardExpiry,
                GlobalConstants.NickName,
                GlobalConstants.MerchantRefNum,
                GlobalConstants.HolderName,
                GlobalConstants.BillingAddressId
            });

            Request request = new Request(
                method: RequestType.Put,
                uri: PrepareUri("/profiles/" + card.ProfileId() + "/cards/" + card.Id()),
                body: card
                );

            dynamic response = _client.ProcessRequest(request);

            Card returnVal = new Card(response);

            returnVal.ProfileId(card.ProfileId());
            return(returnVal);
        }