Ejemplo n.º 1
0
        private static void RunMethod(String methodName)
        {
            // These are default transaction keys.
            // You can create your own keys in seconds by signing up for a sandbox account here: https://developer.authorize.net/sandbox/
            String apiLoginId     = "5KP3u95bQpv";
            String transactionKey = "4Ktq966gC55GAX7S";

            string TransactionAmount = string.Empty;
            string TransactionID     = string.Empty;
            string RefID             = Guid.NewGuid().ToString().Substring(0, 4).ToString();        // a random 4 digit number
            string SubscriptionID    = Guid.NewGuid().ToString().Substring(0, 4).ToString();

            switch (methodName)
            {
            case "VisaCheckoutDecrypt":
                VisaCheckoutDecrypt.Run(apiLoginId, transactionKey);
                break;

            case "VisaCheckoutTransaction":
                VisaCheckoutTransaction.Run(apiLoginId, transactionKey);
                break;

            case "ChargeCreditCard":
                ChargeCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "CaptureOnly":
                CaptureOnly.Run(apiLoginId, transactionKey);
                break;

            case "CapturePreviouslyAuthorizedAmount":
                Console.WriteLine("Enter An Transaction Amount");
                TransactionAmount = Console.ReadLine();

                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                CapturePreviouslyAuthorizedAmount.Run(apiLoginId, transactionKey, Convert.ToDecimal(TransactionAmount), TransactionID);
                break;

            case "AuthorizeCreditCard":
                AuthorizeCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "Refund":
                Console.WriteLine("Enter An Transaction Amount");
                TransactionAmount = Console.ReadLine();

                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                RefundTransaction.Run(apiLoginId, transactionKey, Convert.ToDecimal(TransactionAmount), TransactionID);
                break;

            case "Void":
                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                VoidTransaction.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "DebitBankAccount":
                DebitBankAccount.Run(apiLoginId, transactionKey);
                break;

            case "CreditBankAccount":
                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                CreditBankAccount.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "ChargeTokenizedCard":
                ChargeTokenizedCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "PayPalVoid":
                PayPalVoid.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalAuthorizeCapture":
                PayPalAuthorizeCapture.Run(apiLoginId, transactionKey);
                break;

            case "PayPalAuthorizeCaptureContinue":
                PayPalAuthorizeCaptureContinue.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalAuthorizeOnly":
                PayPalAuthorizeOnly.Run(apiLoginId, transactionKey);
                break;

            case "PayPalAuthorizeOnlyContinue":
                PayPalAuthorizeCaptureContinue.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalCredit":
                PayPalCredit.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalGetDetails":
                PayPalGetDetails.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalPriorAuthorizationCapture":
                PayPalPriorAuthorizationCapture.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "CancelSubscription":
                CancelSubscription.Run(apiLoginId, transactionKey, RefID, SubscriptionID);
                break;

            case "CreateSubscription":
                CreateSubscription.Run(apiLoginId, transactionKey, RefID);
                break;

            case "GetSubscriptionList":
                GetListSubscriptions.Run(apiLoginId, transactionKey, RefID);
                break;

            case "GetSubscriptionStatus":
                GetSubscriptionStatus.Run(apiLoginId, transactionKey, RefID, SubscriptionID);
                break;

            case "UpdateSubscription":
                UpdateSubscription.Run(apiLoginId, transactionKey, RefID, SubscriptionID);
                break;

            default:
                ShowUsage();
                break;
            }
        }
Ejemplo n.º 2
0
        private static void RunMethod(String methodName)
        {
            // These are default transaction keys.
            // You can create your own keys in seconds by signing up for a sandbox account here: https://developer.authorize.net/sandbox/
            String apiLoginId     = "5KP3u95bQpv";
            String transactionKey = "4Ktq966gC55GAX7S";

            string TransactionAmount = string.Empty;
            //Update TransactionID for which you want to run the sample code
            string TransactionID = string.Empty;
            //Update PayerID for which you want to run the sample code
            string payerID = string.Empty;

            switch (methodName)
            {
            case "ValidateCustomerPaymentProfile":
                ValidateCustomerPaymentProfile.Run(apiLoginId, transactionKey);
                break;

            case "UpdateCustomerShippingAddress":
                UpdateCustomerShippingAddress.Run(apiLoginId, transactionKey);
                break;

            case "UpdateCustomerProfile":
                UpdateCustomerProfile.Run(apiLoginId, transactionKey);
                break;

            case "UpdateCustomerPaymentProfile":
                UpdateCustomerPaymentProfile.Run(apiLoginId, transactionKey);
                break;

            case "GetCustomerShippingAddress":
                GetCustomerShippingAddress.Run(apiLoginId, transactionKey);
                break;

            case "GetCustomerProfileIds":
                GetCustomerProfileIds.Run(apiLoginId, transactionKey);
                break;

            case "GetCustomerProfile":
                GetCustomerProfile.Run(apiLoginId, transactionKey);
                break;

            case "GetHostedProfilePage":
                GetHostedProfilePage.Run(apiLoginId, transactionKey);
                break;

            case "GetCustomerPaymentProfile":
                GetCustomerPaymentProfile.Run(apiLoginId, transactionKey);
                break;

            case "DeleteCustomerShippingAddress":
                DeleteCustomerShippingAddress.Run(apiLoginId, transactionKey);
                break;

            case "DeleteCustomerProfile":
                DeleteCustomerProfile.Run(apiLoginId, transactionKey);
                break;

            case "DeleteCustomerPaymentProfile":
                DeleteCustomerPaymentProfile.Run(apiLoginId, transactionKey);
                break;

            case "CreateCustomerShippingAddress":
                CreateCustomerShippingAddress.Run(apiLoginId, transactionKey);
                break;

            case "CreateCustomerProfileFromTransaction":
                CreateCustomerProfileFromTransaction.Run(apiLoginId, transactionKey);
                break;

            case "GetTransactionDetails":
                GetTransactionDetails.Run(apiLoginId, transactionKey);
                break;

            case "GetTransactionList":
                GetTransactionList.Run(apiLoginId, transactionKey);
                break;

            case "CreateAnApplePayTransaction":
                CreateAnApplePayTransaction.Run(apiLoginId, transactionKey);
                break;

            case "DecryptVisaCheckoutData":
                DecryptVisaCheckoutData.Run(apiLoginId, transactionKey);
                break;

            case "CreateVisaCheckoutTransaction":
                CreateVisaCheckoutTransaction.Run(apiLoginId, transactionKey);
                break;

            case "ChargeCreditCard":
                ChargeCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "CaptureOnly":
                CaptureOnly.Run(apiLoginId, transactionKey);
                break;

            case "CapturePreviouslyAuthorizedAmount":
                Console.WriteLine("Enter An Transaction Amount");
                TransactionAmount = Console.ReadLine();

                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                CapturePreviouslyAuthorizedAmount.Run(apiLoginId, transactionKey, Convert.ToDecimal(TransactionAmount), TransactionID);
                break;

            case "CaptureFundsAuthorizedThroughAnotherChannel":
                CaptureFundsAuthorizedThroughAnotherChannel.Run(apiLoginId, transactionKey);
                break;

            case "AuthorizeCreditCard":
                AuthorizeCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "Refund":
                Console.WriteLine("Enter An Transaction Amount");
                TransactionAmount = Console.ReadLine();

                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                RefundTransaction.Run(apiLoginId, transactionKey, Convert.ToDecimal(TransactionAmount), TransactionID);
                break;

            case "Void":
                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                VoidTransaction.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "DebitBankAccount":
                DebitBankAccount.Run(apiLoginId, transactionKey);
                break;

            case "CreditBankAccount":
                Console.WriteLine("Enter An Transaction ID");
                TransactionID = Console.ReadLine();

                CreditBankAccount.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "ChargeCustomerProfile":
                ChargeCustomerProfile.Run(apiLoginId, transactionKey);
                break;

            case "ChargeTokenizedCard":
                ChargeTokenizedCreditCard.Run(apiLoginId, transactionKey);
                break;

            case "PayPalVoid":
                PayPalVoid.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalAuthorizeCapture":
                PayPalAuthorizeCapture.Run(apiLoginId, transactionKey);
                break;

            case "PayPalAuthorizeCaptureContinue":
                Console.Write("Enter Transaction ID : ");
                TransactionID = Console.ReadLine();
                Console.Write("Enter PayerId : ");
                payerID = Console.ReadLine();
                PayPalAuthorizeCaptureContinue.Run(apiLoginId, transactionKey, TransactionID, payerID);
                break;

            case "PayPalAuthorizeOnly":
                PayPalAuthorizeOnly.Run(apiLoginId, transactionKey);
                break;

            case "PayPalAuthorizeOnlyContinue":
                PayPalAuthorizeOnlyContinue.Run(apiLoginId, transactionKey, TransactionID, payerID);
                break;

            case "PayPalCredit":
                PayPalCredit.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalGetDetails":
                PayPalGetDetails.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "PayPalPriorAuthorizationCapture":
                PayPalPriorAuthorizationCapture.Run(apiLoginId, transactionKey, TransactionID);
                break;

            case "CancelSubscription":
                CancelSubscription.Run(apiLoginId, transactionKey);
                break;

            case "CreateSubscription":
                CreateSubscription.Run(apiLoginId, transactionKey);
                break;

            case "GetSubscriptionList":
                GetListSubscriptions.Run(apiLoginId, transactionKey);
                break;

            case "GetSubscriptionStatus":
                GetSubscriptionStatus.Run(apiLoginId, transactionKey);
                break;

            case "UpdateSubscription":
                UpdateSubscription.Run(apiLoginId, transactionKey);
                break;

            case "CreateCustomerProfile":
                CreateCustomerProfile.Run(apiLoginId, transactionKey);
                break;

            case "CreateCustomerPaymentProfile":
                CreateCustomerPaymentProfile.Run(apiLoginId, transactionKey);
                break;

            case "GetUnsettledTransactionList":
                GetUnsettledTransactionList.Run(apiLoginId, transactionKey);
                break;

            case "GetBatchStatistics":
                GetBatchStatistics.Run(apiLoginId, transactionKey);
                break;

            case "GetSettledBatchList":
                GetSettledBatchList.Run(apiLoginId, transactionKey);
                break;

            default:
                ShowUsage();
                break;
            }
        }