Exemplo n.º 1
0
        public ServiceResponse DeletePaymentMethod(String VaultPaymentId)
        {
            OPERATIONPARAMETERS operationParameters = new OPERATIONPARAMETERS();

            operationParameters.ACTIONCODE = 3;
            TRANSACTION_VAULT transactionVault = SecureNetController.GetVaultTransactionWithDefaults();

            transactionVault.ACCOUNT_VAULT            = new ACCOUNT_VAULT();
            transactionVault.ACCOUNT_VAULT.CUSTOMERID = ThisCustomer.CustomerID.ToString();
            transactionVault.ACCOUNT_VAULT.PAYMENTID  = VaultPaymentId;
            transactionVault.OPERATIONPARAMETERS      = operationParameters;
            GATEWAYRESPONSE gatewayResponse = gsClient.ProcessAccount(transactionVault);

            if (gatewayResponse.VAULTACCOUNTRESPONSE.RESPONSE_CODE != "1")
            {
                return(new ServiceResponse(true, gatewayResponse.VAULTACCOUNTRESPONSE.RESPONSE_REASON_TEXT, gatewayResponse.VAULTACCOUNTRESPONSE.RESPONSE_REASON_CODE));
            }

            return(new ServiceResponse(false, "Payment Account Added"));
        }