Beispiel #1
0
        /// <summary>
        /// Get the AuthorizationReversal
        /// </summary>
        /// <param name="authReversal">AuthorizationReversal</param>
        /// <returns>AuthorizationReversal</returns>
        public AuthorizationReversal get(AuthorizationReversal authReversal)
        {
            authReversal.setRequiredFields(new List <string> {
                CardPaymentsConstants.id
            });
            authReversal.checkRequiredFields();

            Request request = new Request(
                method: RequestType.GET,
                uri: this.prepareURI("/voidauths/" + authReversal.id())
                );

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

            return(new AuthorizationReversal(response));
        }
Beispiel #2
0
        /// <summary>
        /// Get matching authorization reversals
        /// </summary>
        /// <param name="authReversal"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Pagerator <AuthorizationReversal> getAuthReversals(AuthorizationReversal authReversal = null, Filter filter = null)
        {
            Dictionary <String, String> queryStr = new Dictionary <String, String>();

            if (authReversal != null && !String.IsNullOrWhiteSpace(authReversal.merchantRefNum()))
            {
                queryStr.Add("merchantRefNum", authReversal.merchantRefNum());
            }
            if (filter != null)
            {
                if (filter.limit != null)
                {
                    queryStr.Add("limit", filter.limit.ToString());
                }
                if (filter.offset != null)
                {
                    queryStr.Add("offset", filter.offset.ToString());
                }
                if (!String.IsNullOrWhiteSpace(filter.startDate))
                {
                    queryStr.Add("startDate", filter.startDate);
                }
                if (!String.IsNullOrWhiteSpace(filter.endDate))
                {
                    queryStr.Add("endDate", filter.endDate);
                }
            }

            Request request = new Request(
                method: RequestType.GET,
                uri: this.prepareURI("/voidauths"),
                queryString: queryStr
                );

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

            return(new Pagerator <AuthorizationReversal>(this.client, typeof(AuthorizationReversal), response));
        }
Beispiel #3
0
        /// <summary>
        /// Reverse
        /// </summary>
        /// <param name="authReversal">AuthorizationReversal</param>
        /// <returns>AuthorizationReversal</returns>
        public AuthorizationReversal reverseAuth(AuthorizationReversal authReversal)
        {
            authReversal.setRequiredFields(new List <string> {
                CardPaymentsConstants.authorizationId
            });
            authReversal.checkRequiredFields();
            authReversal.setRequiredFields(new List <string> {
                CardPaymentsConstants.merchantRefNum
            });
            authReversal.setOptionalFields(new List <string> {
                CardPaymentsConstants.amount,
                CardPaymentsConstants.dupCheck
            });

            Request request = new Request(
                method: RequestType.POST,
                uri: this.prepareURI("/auths/" + authReversal.authorizationId() + "/voidauths"),
                body: authReversal
                );

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

            return(new AuthorizationReversal(response));
        }