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); } }
public override IPaymentGateway GetPaymentGateway() { if (!didLoadSettings) { LoadSettings(); } if ((payPalAPIUsername.Length > 0) && (payPalAPIPassword.Length > 0) && (payPalAPISignature.Length > 0)) { PayPalDirectPaymentGateway gateway = new PayPalDirectPaymentGateway(payPalAPIUsername, payPalAPIPassword, payPalAPISignature); gateway.UseTestMode = paymentGatewayUseTestMode; return(gateway); } return(null); }