Example #1
0
    } // End of the GetMerchantId method

    /// <summary>
    /// Get the secret word for svea web pay
    /// </summary>
    /// <param name="type"> eg. HOSTED, INVOICE or PAYMENTPLAN</param>
    /// <param name="country">country code</param>
    /// <returns>The secret word as a string</returns>
    public string GetSecretWord(Webpay.Integration.CSharp.Util.Constant.PaymentType type, Webpay.Integration.CSharp.Util.Constant.CountryCode country)
    {
        // Get the webshop settings
        KeyStringList webshopSettings = WebshopSetting.GetAllFromCache();

        // Return the secret word
        return(type == Webpay.Integration.CSharp.Util.Constant.PaymentType.HOSTED ? webshopSettings.Get("SVEA-SECRET-WORD") : "");
    } // End of the GetSecretWord method
Example #2
0
    } // End of the GetClientNumber method

    /// <summary>
    /// Get the merchant id for svea web pay
    /// </summary>
    /// <param name="type"> eg. HOSTED, INVOICE or PAYMENTPLAN</param>
    /// <param name="country">country code</param>
    /// <returns>The merchant id as a string</returns>
    public string GetMerchantId(Webpay.Integration.CSharp.Util.Constant.PaymentType type, Webpay.Integration.CSharp.Util.Constant.CountryCode country)
    {
        // Get the company settings
        KeyStringList webshopSettings = WebshopSetting.GetAllFromCache();

        // Return the merchant id
        return(type == Webpay.Integration.CSharp.Util.Constant.PaymentType.HOSTED ? webshopSettings.Get("SVEA-MERCHANT-ID") : "");
    } // End of the GetMerchantId method
Example #3
0
    } // End of the GetPassword method

    /// <summary>
    /// Get the client number for svea web pay
    /// </summary>
    /// <param name="type"> eg. HOSTED, INVOICE or PAYMENTPLAN</param>
    /// <param name="country">country code</param>
    /// <returns>The client number as an int</returns>
    public int GetClientNumber(Webpay.Integration.CSharp.Util.Constant.PaymentType type, Webpay.Integration.CSharp.Util.Constant.CountryCode country)
    {
        // Get the webshop settings
        KeyStringList webshopSettings = WebshopSetting.GetAllFromCache();

        switch (country)
        {
        case Webpay.Integration.CSharp.Util.Constant.CountryCode.SE:
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.INVOICE)
            {
                return(Convert.ToInt32(webshopSettings.Get("SVEA-SE-INVOICE-CLIENT-NUMBER")));
            }
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.PAYMENTPLAN)
            {
                return(59999);
            }
            break;

        case Webpay.Integration.CSharp.Util.Constant.CountryCode.NO:
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.INVOICE)
            {
                return(Convert.ToInt32(webshopSettings.Get("SVEA-NO-INVOICE-CLIENT-NUMBER")));
            }
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.PAYMENTPLAN)
            {
                return(32503);
            }
            break;

        case Webpay.Integration.CSharp.Util.Constant.CountryCode.FI:
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.INVOICE)
            {
                return(Convert.ToInt32(webshopSettings.Get("SVEA-FI-INVOICE-CLIENT-NUMBER")));
            }
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.PAYMENTPLAN)
            {
                return(27136);
            }
            break;

        case Webpay.Integration.CSharp.Util.Constant.CountryCode.DK:
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.INVOICE)
            {
                return(Convert.ToInt32(webshopSettings.Get("SVEA-DK-INVOICE-CLIENT-NUMBER")));
            }
            if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.PAYMENTPLAN)
            {
                return(64008);
            }
            break;
        }
        return(0);
    } // End of the GetClientNumber method
Example #4
0
    } // End of the GetSecretWord method

    /// <summary>
    /// Get the end point for svea web pay
    /// </summary>
    /// <param name="type"> eg. HOSTED, INVOICE or PAYMENTPLAN</param>
    /// <returns>The end point url as a string</returns>
    public string GetEndPoint(Webpay.Integration.CSharp.Util.Constant.PaymentType type)
    {
        // Get the webshop settings
        KeyStringList webshopSettings = WebshopSetting.GetAllFromCache();

        // Get the test value
        string sveaTest = webshopSettings.Get("SVEA-TEST");

        // Check if we are in the test mode or the production mode
        if (sveaTest.ToLower() == "true")
        {
            return(type == Webpay.Integration.CSharp.Util.Constant.PaymentType.HOSTED ? Webpay.Integration.CSharp.Config.SveaConfig.GetTestPayPageUrl() : Webpay.Integration.CSharp.Config.SveaConfig.GetTestWebserviceUrl());
        }
        else
        {
            return(type == Webpay.Integration.CSharp.Util.Constant.PaymentType.HOSTED ? Webpay.Integration.CSharp.Config.SveaConfig.GetProdPayPageUrl() : Webpay.Integration.CSharp.Config.SveaConfig.GetProdWebserviceUrl());
        }
    } // End of the GetEndPoint method
Example #5
0
    } // End of the GetUsername method

    /// <summary>
    /// Get the password for svea web pay
    /// </summary>
    /// <param name="type"> eg. HOSTED, INVOICE or PAYMENTPLAN</param>
    /// <param name="country">country code</param>
    /// <returns>The password as a string</returns>
    public string GetPassword(Webpay.Integration.CSharp.Util.Constant.PaymentType type, Webpay.Integration.CSharp.Util.Constant.CountryCode country)
    {
        // Get the webshop settings
        KeyStringList webshopSettings = WebshopSetting.GetAllFromCache();

        if (type == Webpay.Integration.CSharp.Util.Constant.PaymentType.INVOICE || type == Webpay.Integration.CSharp.Util.Constant.PaymentType.PAYMENTPLAN)
        {
            switch (country)
            {
            case Webpay.Integration.CSharp.Util.Constant.CountryCode.SE:
                return(webshopSettings.Get("SVEA-SE-PASSWORD"));

            case Webpay.Integration.CSharp.Util.Constant.CountryCode.NO:
                return(webshopSettings.Get("SVEA-NO-PASSWORD"));

            case Webpay.Integration.CSharp.Util.Constant.CountryCode.FI:
                return(webshopSettings.Get("SVEA-FI-PASSWORD"));

            case Webpay.Integration.CSharp.Util.Constant.CountryCode.DK:
                return(webshopSettings.Get("SVEA-DK-PASSWORD"));
            }
        }
        return("");
    } // End of the GetPassword method