Esempio n. 1
0
    public static string GetPaymentButtons(BaseButtonGenerator bg)
    {
        var BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC);

        int           buttonsPresent = 0;
        StringBuilder sb             = new StringBuilder();

        foreach (var t in PaymentAccountDetails.PaymentAccountDetailsClasses)
        {
            var instance = Activator.CreateInstance(t);

            var gateway = (PaymentAccountDetails)PaymentAccountDetails.RunStaticMethod(t, "GetFirstIncomeGateway");

            if (gateway != null && gateway.AccountType != "MPesaAgent") //MPesaAgent do not support payment buttons
            {
                bg.Strategy = gateway.GetStrategy();
                sb.Append(bg.Generate());
                buttonsPresent++;
            }
        }

        if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons())
        {
            sb.Append(GetBtcButton(bg));
            buttonsPresent++;
        }

        if (buttonsPresent == 0)
        {
            return(U6011.NOACTIVEPAYMENTPROCESSORS);
        }

        return(sb.ToString());
    }
Esempio n. 2
0
    public static string GetPaymentButton(BaseButtonGenerator bg, CryptocurrencyType t)
    {
        var cryptocurrency = CryptocurrencyFactory.Get(t);
        var sb             = new StringBuilder();

        if (cryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(cryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons())
        {
            sb.Append(GetBtcButton(bg));
        }

        return(string.IsNullOrEmpty(sb.ToString()) ? U6011.NOACTIVEPAYMENTPROCESSORS : sb.ToString());
    }
Esempio n. 3
0
    public static string GetBtcButton(BaseButtonGenerator bg)
    {
        StringBuilder sb = new StringBuilder();
        var           BtcCryptocurrency = CryptocurrencyFactory.Get(CryptocurrencyType.BTC);

        if (BtcCryptocurrency.DepositEnabled && CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).AllowToUsePaymentButtons())
        {
            bg.Strategy = CryptocurrencyApiFactory.Get(BtcCryptocurrency.DepositApiProcessor).GetStrategy();
            sb.Append(bg.Generate());
        }

        return(sb.ToString());
    }
Esempio n. 4
0
    public static string GetPaymentButton(BaseButtonGenerator bg, Type t)
    {
        var sb       = new StringBuilder();
        var instance = Activator.CreateInstance(t);
        var gateway  = (PaymentAccountDetails)PaymentAccountDetails.RunStaticMethod(t, "GetFirstIncomeGateway");

        if (gateway != null && gateway.AccountType != "MPesaAgent") //MPesaAgent do not support payment buttons
        {
            bg.Strategy = gateway.GetStrategy();
            sb.Append(bg.Generate());
        }

        return(string.IsNullOrEmpty(sb.ToString()) ? U6011.NOACTIVEPAYMENTPROCESSORS : sb.ToString());
    }