コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: I-D-X/Sample-Code
        public void performSettlement(string TransactionIdValue, string GatewayID, string MerchantUID, string ApplicationUID)
        {
            //Sandbox service
            //wsCCPayments_sandbox.ePayService settleReference = new wsCCPayments_sandbox.ePayService();

            //Production service
            wsCCPayments.ePayService settleReference = new wsCCPayments.ePayService();

            object[] arrResults2 = settleReference.fProcess(
                GatewayID,                                                                              //Gateway
                MerchantUID,                                                                            //MerchantID
                ApplicationUID,                                                                         //ApplicationID
                "3",                                                                                    //Action
                TransactionIdValue,                                                                     //TransactionIndex
                "",                                                                                     //Terminal
                "",                                                                                     //Mode
                "",                                                                                     //MerchantReference
                "",                                                                                     //Amount
                "",                                                                                     //Currency
                "",                                                                                     //CashBackAmount
                "",                                                                                     //CardType
                "",                                                                                     //AccountType
                "",                                                                                     //CardNumber
                "",                                                                                     //CardHolder
                "",                                                                                     //CCVNumber
                "",                                                                                     //ExpiryMonth
                "",                                                                                     //ExpiryYear
                "",                                                                                     //Budget
                "",                                                                                     //BudgetPeriod
                "",                                                                                     //AuthorizationNumber
                "",                                                                                     //PIN
                "",                                                                                     //DebugMode
                "",                                                                                     //eCommerceIndicator
                "",                                                                                     //verifiedByVisaXID
                "",                                                                                     //verifiedByVisaCAFF
                "",                                                                                     //secureCodeUCAF
                "",                                                                                     //UCI
                "",                                                                                     //IP Address
                "",                                                                                     //Shipping Country Code,
                ""                                                                                      //Purchase Items ID
                );

            #endregion

            #region Unpack results
            Response.Write("<br><b>Purchase results:</b><br>");

            foreach (string result in arrResults2)
            {
                //unpack result array
                int    delimiter   = result.IndexOf("||");
                string resultDefn  = result.Substring(0, delimiter);
                string resultValue = result.Substring(delimiter + 2);

                Response.Write(resultDefn);
                Response.Write(": ");
                Response.Write(resultValue);
                Response.Write("<br>");
            }
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: I-D-X/Sample-Code
        public void performAuth(string TransactionIdValue, string GatewayID, string MerchantUID, string ApplicationUID, string Terminal,
                                int Mode, string Amount, string Currency, string CardType, string CardNumber, string CardHolder,
                                string CVV, string ExpiryMonth, string ExpiryYear)
        {
            //Sandbox service
            //wsCCPayments_sandbox.ePayService authReference = new wsCCPayments_sandbox.ePayService();

            //Production service
            wsCCPayments.ePayService authReference = new wsCCPayments.ePayService();

            object[] arrResults = authReference.fProcess(
                GatewayID,                                                                              //GatewayID
                MerchantUID,                                                                            //MerchantUID
                ApplicationUID,                                                                         //ApplicationUID
                "1",                                                                                    //Action
                TransactionIdValue,                                                                     //TransactionIndex
                Terminal,                                                                               //Terminal
                Mode.ToString(),                                                                        //Mode
                "Ref12345",                                                                             //MerchantReference
                Amount,                                                                                 //Amount
                Currency,                                                                               //Currency
                "",                                                                                     //CashBackAmount
                CardType,                                                                               //CardType
                "",                                                                                     //AccountType
                CardNumber,                                                                             //CardNumber
                CardHolder,                                                                             //CardHolder
                CVV,                                                                                    //CCVNumber
                ExpiryMonth,                                                                            //ExpiryMonth
                ExpiryYear,                                                                             //ExpiryYear
                "0",                                                                                    //Budget
                "",                                                                                     //BudgetPeriod
                "",                                                                                     //AuthorizationNumber
                "",                                                                                     //PIN
                "",                                                                                     //DebugMode
                "",                                                                                     //eCommerceIndicator
                "",                                                                                     //verifiedByVisaXID
                "",                                                                                     //verifiedByVisaCAFF
                "",                                                                                     //secureCodeUCAF
                "",                                                                                     //UCI
                "",                                                                                     //IP Address
                "ZA",                                                                                   //Shipping Country Code,
                ""                                                                                      //Purchase Items ID
                );

            Response.Write("<b>Authorisation results:</b><br>");

            System.Boolean authorisationSuccessful = false;
            string         transactionIndex        = "";

            foreach (string result in arrResults)
            {
                //unpack result array
                if (result != null)
                {
                    int    delimiter   = result.IndexOf("||");
                    string resultDefn  = result.Substring(0, delimiter);
                    string resultValue = result.Substring(delimiter + 2);

                    //if 'result' not -1, authorisation was successful
                    if (resultDefn == "Result" && resultValue != "-1")
                    {
                        authorisationSuccessful = true;
                    }
                    if (resultDefn == "TransactionIndex")
                    {
                        transactionIndex = resultValue;
                    }

                    Response.Write(resultDefn);
                    Response.Write(": ");
                    Response.Write(resultValue);
                    Response.Write("<br>");
                }
            }

            if (authorisationSuccessful)
            {
                performSettlement(transactionIndex, GatewayID, MerchantUID, ApplicationUID);
            }
        }