private Types.Recipient recipientFactory(string response)
        {
            var tempData = JObject.Parse(response)["recipient"];

            Types.Recipient recipient = JsonConvert.DeserializeObject <Types.Recipient>(tempData.ToString());
            return(recipient);
        }
        public bool update(Types.Recipient recipient)
        {
            string endPoint = "/v1/recipients/" + recipient.id;

            gateway.client.patch(endPoint, recipient);
            return(true);
        }
        public Types.Recipient create(Types.Recipient recipient)
        {
            string endPoint = "/v1/recipients";
            string response = this.gateway.client.post(endPoint, recipient);

            return(recipientFactory(response));
        }
 public bool delete(Types.Recipient recipient)
 {
     return(delete(recipient.id));
 }
예제 #5
0
 /// <summary>
 /// Updates a recipient based on the recipient id given and the body
 /// given to the client
 /// </summary>
 ///<param name="recipient">A recipient object that will be updated</param>
 /// <returns>The response</returns>
 public static bool update(Types.Recipient recipient)
 {
     return(Configuration.gateway().recipient.update(recipient));
 }
예제 #6
0
 /// <summary>
 /// Creates a recipient based on the body given to the client
 /// </summary>
 /// <param name="recipient">A recipient object that will be created</param>
 /// <returns>A newly created recipient object</returns>
 public static Types.Recipient create(Types.Recipient recipient)
 {
     return(Configuration.gateway().recipient.create(recipient));
 }