Exemple #1
0
        /// <summary>
        /// Create profile
        /// </summary>
        /// <param name="profile">Profile</param>
        /// <returns>Profile</returns>
        public Profile Create(Profile profile)
        {
            profile.SetRequiredFields(new List <string> {
                GlobalConstants.MerchantCustomerId,
                GlobalConstants.Locale
            });
            profile.SetOptionalFields(new List <string> {
                GlobalConstants.FirstName,
                GlobalConstants.MiddleName,
                GlobalConstants.LastName,
                GlobalConstants.DateOfBirth,
                GlobalConstants.Ip,
                GlobalConstants.Gender,
                GlobalConstants.Nationality,
                GlobalConstants.Email,
                GlobalConstants.Phone,
                GlobalConstants.CellPhone,
                GlobalConstants.Card
            });

            Request request = new Request(
                method: RequestType.Post,
                uri: PrepareUri("/profiles"),
                body: profile
                );
            dynamic response = _client.ProcessRequest(request);

            return(new Profile(response));
        }