Ejemplo n.º 1
0
        private Transaction ProcessRecurringResponse(AuthorizeRecurringTransactionRequest authRequest, RecurringResponse response)
        {
            //CREATE THE TRANSACTION OBJECT
            Transaction transaction = new Transaction();

            transaction.PaymentGatewayId = this.PaymentGatewayId;
            transaction.TransactionType  = TransactionType.AuthorizeRecurring;
            LSDecimal transAmount = authRequest.RecurringChargeSpecified ? authRequest.RecurringCharge : authRequest.Amount;

            transaction.Amount = transAmount;

            if (response.getResponseCode() != 1)
            {
                transaction.TransactionStatus = TransactionStatus.Failed;
                transaction.ResponseCode      = response.getResponseCode().ToString();
                transaction.ResponseMessage   = response.getResponseCodeText();
            }
            else
            {
                transaction.TransactionStatus = TransactionStatus.Successful;
                //transaction.ProviderTransactionId = response.getReferenceId();
                transaction.TransactionDate = response.getTimeStamp();
                transaction.ResponseCode    = response.getResponseCode().ToString();
                transaction.ResponseMessage = response.getResponseCodeText();

                HttpContext context = HttpContext.Current;
                if (context != null)
                {
                    transaction.RemoteIP = context.Request.ServerVariables["REMOTE_ADDR"];
                    transaction.Referrer = context.Request.ServerVariables["HTTP_REFERER"];
                }
            }

            return(transaction);
        }
Ejemplo n.º 2
0
        private string BuildRecurringResponseDebug(RecurringResponse response)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("\r\nParadata PayGateway.RecurringResponse Object\r\n");
            sb.Append("ResponseCode=" + response.getResponseCode() + "\r\n");
            sb.Append("ResponseCodeText=" + response.getResponseCodeText() + "\r\n");
            sb.Append("SecondaryResponseCode=" + response.getSecondaryResponseCode() + "\r\n");
            sb.Append("TimeStamp=" + response.getTimeStamp() + "\r\n");
            //sb.Append("responseString=" + response.responseString + "\r\n");

            return(sb.ToString());
        }