public IPaymentGateway GetDirectPaymentGateway()
        {
            if (!CanProcessStandardCards)
            {
                return(null);
            }

            IPaymentGateway gateway = null;

            switch (PrimaryPaymentGateway)
            {
            case "PayPalDirect":
                gateway = new PayPalDirectPaymentGateway(
                    PayPalAPIUsername,
                    PayPalAPIPassword,
                    PayPalAPISignature);

                gateway.UseTestMode = PaymentGatewayUseTestMode;

                return(gateway);

            case "Authorize.NET":

                gateway = new AuthorizeNETPaymentGateway(
                    AuthorizeNetAPILogin,
                    AuthorizeNetAPITransactionKey);

                gateway.UseTestMode = PaymentGatewayUseTestMode;

                return(gateway);

            case "PlugNPay":

                gateway = new PlugNPayPaymentGateway(
                    PlugNPayAPIPublisherName,
                    PlugNPayAPIPublisherPassword);

                gateway.UseTestMode = PaymentGatewayUseTestMode;

                return(gateway);

            case "PayPalExpress":
            case "GoogleCheckout":
            default:

                return(gateway);
            }
        }
Beispiel #2
0
        public override IPaymentGateway GetPaymentGateway()
        {
            if (!didLoadSettings)
            {
                LoadSettings();
            }

            if ((authorizeNetAPILogin.Length > 0) && (authorizeNetAPITransactionKey.Length > 0))
            {
                AuthorizeNETPaymentGateway gateway = new AuthorizeNETPaymentGateway(authorizeNetAPILogin, authorizeNetAPITransactionKey);
                gateway.UseTestMode = paymentGatewayUseTestMode;
                return(gateway);
            }

            return(null);
        }