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

            Types.RecipientAccount recipientAccount = JsonConvert.DeserializeObject <Types.RecipientAccount>(tempData.ToString());
            return(recipientAccount);
        }
        public Types.RecipientAccount create(string recipient_id, Types.RecipientAccount recipientAccount)
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendFormat("/v1/recipients/{0}/accounts", recipient_id);
            string endPoint = builder.ToString();
            string response = this.gateway.client.post(endPoint, recipientAccount);

            return(recipientFactory(response));
        }
Beispiel #3
0
 /// <summary>
 /// Checks whether all fields are equivalent to the object being compared
 /// </summary>
 /// <param name="obj">The object to compare to</param>
 /// <returns>whether the objects are equal</returns>
 public override bool Equals(object obj)
 {
     if (obj != null && obj.GetType() == this.GetType())
     {
         RecipientAccount other = (RecipientAccount)obj;
         if (other.id == this.id && other.primary == this.primary && other.currency == this.currency && other.recipientAccountId == this.recipientAccountId &&
             other.routeType == this.routeType && other.recipientFees == this.recipientFees && other.emailAddress == this.emailAddress && other.country == this.country &&
             other.type == this.type && other.iban == this.iban && other.accountNum == this.accountNum && other.accountHolderName == this.accountHolderName &&
             other.swiftBic == this.swiftBic && other.branchId == this.branchId && other.bankName == this.bankName && other.bankId == this.bankId && other.bankAddress == this.bankAddress &&
             other.bankCity == this.bankCity && other.bankRegionCode == this.bankRegionCode && other.bankPostalCode == this.bankPostalCode)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
 /// <summary>
 /// Deletes a recipient account for the given recipient
 /// </summary>
 /// <param name="recipient_id"></param>
 /// <param name="recipientAccount"></param>
 /// <returns></returns>
 public static bool delete(string recipient_id, Types.RecipientAccount recipientAccount)
 {
     return(delete(recipient_id, recipientAccount.id));
 }
Beispiel #5
0
 /// <summary>
 /// Updates a recipient account for the given recipient
 /// </summary>
 /// <param name="recipient_id"></param>
 /// <param name="recipientAccount"></param>
 /// <returns></returns>
 public static Types.RecipientAccount update(string recipient_id, Types.RecipientAccount recipientAccount)
 {
     return(Configuration.gateway().recipientAccount.update(recipient_id, recipientAccount));
 }