Ejemplo n.º 1
0
        /// <summary>
        /// Create SEPABankAccount
        /// </summary>
        /// <param name="SEPABankAccount">SEPABankAccount</param>
        /// <returns>SEPABankAccount</returns>
        public SEPABankAccounts create(SEPABankAccounts account)
        {
            account.setRequiredFields(new List <string> {
                CustomerVaultConstants.profileId
            });
            account.checkRequiredFields();
            account.setRequiredFields(new List <string> {
                CustomerVaultConstants.iban,
                CustomerVaultConstants.bic,
                CustomerVaultConstants.accountHolderName,
                CustomerVaultConstants.billingAddressId,
            });
            account.checkRequiredFields();
            account.setOptionalFields(new List <string> {
                CustomerVaultConstants.nickName,
                CustomerVaultConstants.merchantRefNum,
                CustomerVaultConstants.mandates
            });

            Request request = new Request(
                method: RequestType.POST,
                uri: this.prepareURI("/profiles/" + account.profileId() + "/sepabankaccounts"),
                body: account
                );
            dynamic response = this.client.processRequest(request);

            SEPABankAccounts returnVal = new SEPABankAccounts(response);

            returnVal.profileId(account.profileId());
            return(returnVal);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///Delete SEPABankAccount
        /// </summary>
        /// <param name="SEPABankAccount">SEPABankAccount</param>
        /// <returns>bool</returns>
        public bool delete(SEPABankAccounts account)
        {
            account.setRequiredFields(new List <string> {
                CustomerVaultConstants.profileId,
                CustomerVaultConstants.id
            });
            account.checkRequiredFields();

            Request request = new Request(
                method: RequestType.DELETE,
                uri: this.prepareURI("/profiles/" + account.profileId() + "/sepabankaccounts/" + account.id())
                );

            this.client.processRequest(request);
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get SEPABankAccount
        /// </summary>
        /// <param name="SEPABankAccount">SEPABankAccount</param>
        /// <returns>SEPABankAccount</returns>
        public SEPABankAccounts get(SEPABankAccounts account)
        {
            account.setRequiredFields(new List <string> {
                CustomerVaultConstants.billingAddressId,
                CustomerVaultConstants.id
            });
            account.checkRequiredFields();
            Request request = new Request(
                method: RequestType.GET,
                uri: this.prepareURI("/profiles/" + account.profileId() + "/sepabankaccounts/" + account.id())
                );

            dynamic response = this.client.processRequest(request);

            SEPABankAccounts returnVal = new SEPABankAccounts(response);

            returnVal.profileId(account.profileId());
            return(returnVal);
        }