Esempio n. 1
0
        public Transaction_Result Void(Void_Details details)
        {
            try
            {
                var gateway = newClient();

                Result <Transaction> Tresult = gateway.Transaction.Void(details.TransactionIndex);

                Transaction_Result result = formatResult(null, Tresult);
                return(result);
            }
            catch (Exception ex)
            {
                return(new Transaction_Result
                {
                    isApproved = false,
                    hasServerError = true,
                    ErrorText = ex.Message
                });
            }
        }
Esempio n. 2
0
        public Transaction_Result Void(Void_Details details)
        {
            try
            {
                var gateway = newClient();

                object[] arrResults = gateway.fProcess(
                    "01",                     //GatewayID
                    MerchantUID,              //MerchantUID
                    PaymentApplicationUID,    //ApplicationUID
                    "2",                      //2 Authorization Reversal Request                              //Action
                    details.TransactionIndex, //TransactionIndex
                    "",                       //Terminal
                    "",                       //Mode
                    "",                       //MerchantReference
                    "",                       //Amount
                    "",                       //Currency
                    "",                       //CashBackAmount
                    "",                       //CardType
                    "",                       //AccountType
                    "",                       //CardNumber
                    "",                       //CardHolder
                    "",                       //CCVNumber
                    "",                       //ExpiryMonth
                    "",                       //ExpiryYear
                    "",                       //Budget - 0 Straight, 1 budget
                    "",                       //BudgetPeriod
                    "",                       //AuthorizationNumber
                    "",                       //PIN
                    "",                       //DebugMode
                    "",                       //eCommerceIndicator
                    "",                       //verifiedByVisaXID
                    "",                       //verifiedByVisaCAFF
                    "",                       //secureCodeUCAF
                    "",                       //UCI
                    "",                       //IP Address
                    "",                       //Shipping Country Code,
                    ""                        //Purchase Items ID
                    );


                var results = formatResult(arrResults);

                string cardnumber  = details.CardNumber;
                string last4digits = "";
                if (!String.IsNullOrEmpty(cardnumber))
                {
                    Regex rgx = new Regex(@"[^\d]");
                    cardnumber  = rgx.Replace(cardnumber, String.Empty); //removes dashes spaces, etc
                    last4digits = cardnumber.Substring(details.CardNumber.Length - 4);
                }


                var stringwriter = new System.IO.StringWriter();
                var serializer   = new XmlSerializer(details.GetType());
                serializer.Serialize(stringwriter, details);
                var fullrequest = stringwriter.ToString();

                if (!String.IsNullOrEmpty(cardnumber))
                {
                    fullrequest = fullrequest.Replace(cardnumber, last4digits);
                }

                if (!String.IsNullOrEmpty(details.CVV))
                {
                    fullrequest = fullrequest.Replace(details.CVV, "***");
                }


                results.FullRequest = fullrequest;
                return(results);
            }
            catch (Exception ex)
            {
                return(new Transaction_Result
                {
                    isApproved = false,
                    hasServerError = true,
                    ErrorText = ex.Message
                });
            }
        }
Esempio n. 3
0
        public Transaction_Result Void(Void_Details details)
        {
            try
            {
                var gateway = newClient();

                DoTransactionResponseMessage gateWayResult = gateway.doTransaction(
                    "ONE_ZERO",
                    SafeKey,
                    transactionType.RESERVE_CANCEL,
                    authenticationType.NA,
                    new additionalInfo {
                    merchantReference = "CANCEL-" + details.TransactionIndex, payUReference = details.TransactionIndex
                },
                    null,
                    new basket {
                    amountInCents = (details.Amount * 100).ToString(), currencyCode = details.CurrencyCode
                },
                    null,
                    new creditCard[]
                {
                    new creditCard
                    {
                        amountInCents = (details.Amount * 100).ToString(),
                    }
                },
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null,
                    null
                    );

                var results = gateWayResult;


                if (results.successful)
                {
                    return(new Transaction_Result
                    {
                        isApproved = true,
                        ApprovalCode = results.resultCode,
                        ResultCode = results.resultCode,
                        ResultText = results.resultMessage,
                        TransactionIndex = results.payUReference,
                        hasServerError = false,
                        FullRequest = getXmlString(details),
                        FullResponse = getXmlString(results)
                    });
                }
                else
                {
                    return(new Transaction_Result
                    {
                        isApproved = false,
                        hasServerError = false,
                        ErrorCode = results.resultCode,
                        ErrorText = results.resultMessage,
                        FullResponse = getXmlString(results),
                        FullRequest = getXmlString(details)
                    });
                }
            }
            catch (Exception ex)
            {
                return(new Transaction_Result
                {
                    isApproved = false,
                    hasServerError = true,
                    ErrorText = ex.Message
                });
            }
        }
Esempio n. 4
0
 //NOT IMPLEMENTED
 public Transaction_Result Void(Void_Details details)
 {
     throw new NotSupportedException();
 }
 public Transaction_Result Void(Void_Details details)
 {
     throw new NotImplementedException();
 }
        //wont work with auto settle on
        public Transaction_Result Void(Void_Details details)
        {
            string qs = getVoidQS(CompanyID, Outlet, details.TransactionIndex, details.Amount.Value.ToString("F2"), Username, Password, details.CardNumber, details.ExpYear.ToString(), details.ExpMonth.ToString(), details.CVV);

            return(PostManagerTransaction("https://manager.setcom.co.za/captures2s.cfm", qs));
        }