public void RefundWithTrackData() {
            HpsTrackData trackData = new HpsTrackData {
                Value = "%B5473500000000014^MC TEST CARD^251210199998888777766665555444433332?;5473500000000014=25121019999888877776?",
                Method = HpsTrackDataMethod.Swipe
            };

            var creditService = new HpsCreditService(ServicesConfig);
            HpsRefund response = creditService.Refund(12.00M, "USD", trackData);
            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
        /// <summary>
        /// Refunds a payment
        /// </summary>
        /// <param name="refundPaymentRequest">Request</param>
        /// <returns>Result</returns>
        public RefundPaymentResult Refund(RefundPaymentRequest refundPaymentRequest)
        {
            var result = new RefundPaymentResult();

            var config = new HpsServicesConfig();
            config.SecretApiKey = _secureSubmitPaymentSettings.SecretApiKey;
            config.DeveloperId = "002914";
            config.VersionNumber = "1513";

            var creditService = new HpsCreditService(config);

            try
            {
                creditService.Refund(
                    refundPaymentRequest.AmountToRefund,
                    _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode,
                    refundPaymentRequest.Order.CaptureTransactionId);

                var isOrderFullyRefunded = (refundPaymentRequest.AmountToRefund + refundPaymentRequest.Order.RefundedAmount == refundPaymentRequest.Order.OrderTotal);
                result.NewPaymentStatus = isOrderFullyRefunded ? PaymentStatus.Refunded : PaymentStatus.PartiallyRefunded;
            }
            catch (HpsException ex)
            {
                result.AddError(ex.Message);
            }

            return result;
        }