/// <summary> /// Create SEPABankAccount /// </summary> /// <param name="SEPABankAccount">SEPABankAccount</param> /// <returns>SEPABankAccount</returns> public SepaBankAccounts Create(SepaBankAccounts account) { account.SetRequiredFields(new List <string> { GlobalConstants.ProfileId }); account.CheckRequiredFields(); account.SetRequiredFields(new List <string> { GlobalConstants.Iban, GlobalConstants.Bic, GlobalConstants.AccountHolderName, GlobalConstants.BillingAddressId, }); account.CheckRequiredFields(); account.SetOptionalFields(new List <string> { GlobalConstants.NickName, GlobalConstants.MerchantRefNum, GlobalConstants.Mandates }); Request request = new Request( method: RequestType.Post, uri: PrepareUri("/profiles/" + account.ProfileId() + "/sepabankaccounts"), body: account ); dynamic response = _client.ProcessRequest(request); SepaBankAccounts returnVal = new SepaBankAccounts(response); returnVal.ProfileId(account.ProfileId()); return(returnVal); }
/// <summary> ///Delete SEPABankAccount /// </summary> /// <param name="SEPABankAccount">SEPABankAccount</param> /// <returns>bool</returns> public bool Delete(SepaBankAccounts account) { account.SetRequiredFields(new List <string> { GlobalConstants.ProfileId, GlobalConstants.Id }); account.CheckRequiredFields(); Request request = new Request( method: RequestType.Delete, uri: PrepareUri("/profiles/" + account.ProfileId() + "/sepabankaccounts/" + account.Id()) ); _client.ProcessRequest(request); return(true); }
/// <summary> /// Get SEPABankAccount /// </summary> /// <param name="SEPABankAccount">SEPABankAccount</param> /// <returns>SEPABankAccount</returns> public SepaBankAccounts Get(SepaBankAccounts account) { account.SetRequiredFields(new List <string> { GlobalConstants.BillingAddressId, GlobalConstants.Id }); account.CheckRequiredFields(); Request request = new Request( method: RequestType.Get, uri: PrepareUri("/profiles/" + account.ProfileId() + "/sepabankaccounts/" + account.Id()) ); dynamic response = _client.ProcessRequest(request); SepaBankAccounts returnVal = new SepaBankAccounts(response); returnVal.ProfileId(account.ProfileId()); return(returnVal); }