Esempio n. 1
0
    def __init__(self, *args, **kwargs):
        merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
        if not merchant_settings or not merchant_settings.get("beanstream"):
            raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                       "configured." % self.display_name)
        beanstream_settings = merchant_settings[
            "beanstream"]  # Not used right now

        self.supported_cardtypes = [
            Visa, MasterCard, AmericanExpress, Discover
        ]

        hash_validation = True if kwargs.get("hashValue", 0) else False

        self.beangw = Beanstream(
            hash_validation=True,  # hash_validation,
            require_billing_address=False,
            require_cvd=True)

        merchant_id = kwargs.pop("merchant_id", None)
        login_company = kwargs.pop("login_company", None)
        login_user = kwargs.pop("login_user", None)
        login_password = kwargs.pop("login_password", None)

        self.beangw.configure(merchant_id, login_company, login_user,
                              login_password, **kwargs)
        '''
Esempio n. 2
0
 def __init__(self):
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("stripe"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     stripe_settings = merchant_settings["stripe"]
     self.api_key = stripe_settings['API_KEY']
     self.stripe = stripe
Esempio n. 3
0
 def __init__(self):
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("authorize_net"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     authorize_net_settings = merchant_settings["authorize_net"]
     self.login = authorize_net_settings["LOGIN_ID"]
     self.password = authorize_net_settings["TRANSACTION_KEY"]
Esempio n. 4
0
 def __init__(self):
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("we_pay"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     super(WePayGateway, self).__init__()
     production = not self.test_mode
     self.we_pay = WePay(production)
     self.we_pay_settings = merchant_settings["we_pay"]
Esempio n. 5
0
 def __init__(self):
     try:
         self.test_mode = settings.MERCHANT_TEST_MODE
         mode = 'TEST' if self.test_mode else 'LIVE'
         self.secret_key = settings.MERCHANT_SETTINGS["pin"]['SECRET']
         self.endpoint = self.endpoints[mode]
     except (AttributeError, KeyError):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
Esempio n. 6
0
 def __init__(self):
     test_mode = getattr(settings, "MERCHANT_TEST_MODE", True)
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("chargebee"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     chargebee_settings = merchant_settings["chargebee"]
     self.chargebee_api_key = chargebee_settings["API_KEY"]
     chargebee_site = chargebee_settings["SITE"]
     self.chargebee_api_base_url = "https://%s.chargebee.com/api/v1" % chargebee_site
Esempio n. 7
0
 def __init__(self):
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("samurai"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     samurai_settings = merchant_settings["samurai"]
     samurai_config.merchant_key = samurai_settings['MERCHANT_KEY']
     samurai_config.merchant_password = samurai_settings[
         'MERCHANT_PASSWORD']
     samurai_config.processor_token = samurai_settings['PROCESSOR_TOKEN']
     self.samurai = samurai
Esempio n. 8
0
    def __init__(self):
        merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
        if not merchant_settings or not merchant_settings.get("paylane"):
            raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                       "configured." % self.display_name)
        paylane_settings = merchant_settings["paylane"]
        wsdl = paylane_settings.get('WSDL', 'https://direct.paylane.com/wsdl/production/Direct.wsdl')
        wsdl_cache = paylane_settings.get('SUDS_CACHE_DIR', '/tmp/suds')
        username = paylane_settings.get('USERNAME', '')
        password = paylane_settings.get('PASSWORD', '')

        self.client = Client(wsdl, username=username, password=password, cache=ObjectCache(location=wsdl_cache, days=15))
Esempio n. 9
0
 def __init__(self):
     test_mode = getattr(settings, "MERCHANT_TEST_MODE", True)
     if test_mode:
         env = braintree.Environment.Sandbox
     else:
         env = braintree.Environment.Production
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("braintree_payments"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     braintree_settings = merchant_settings['braintree_payments']
     braintree.Configuration.configure(
         env,
         braintree_settings['MERCHANT_ACCOUNT_ID'],
         braintree_settings['PUBLIC_KEY'],
         braintree_settings['PRIVATE_KEY']
         )
Esempio n. 10
0
    def __init__(self):
        test_mode = getattr(settings, "MERCHANT_TEST_MODE", True)
        merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
        if not merchant_settings or not merchant_settings.get("bitcoin"):
            raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                       "configured." % self.display_name)
        bitcoin_settings = merchant_settings["bitcoin"]

        self.rpcuser = bitcoin_settings["RPCUSER"]
        self.rpcpassword = bitcoin_settings["RPCPASSWORD"]
        self.host = bitcoin_settings.get("HOST", "127.0.0.1")
        self.port = bitcoin_settings.get("PORT", "8332")
        self.account = bitcoin_settings["ACCOUNT"]
        self.minconf = bitcoin_settings.get("MINCONF", 1)

        self.connection = bitcoinrpc.connect_to_remote(self.rpcuser,
                                                       self.rpcpassword,
                                                       self.host, self.port)
Esempio n. 11
0
    def __init__(self):
        self.test_mode = getattr(settings, 'MERCHANT_TEST_MODE', True)
        merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
        if not merchant_settings or not merchant_settings.get("eway"):
            raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                       "configured." % self.display_name)
        eway_settings = merchant_settings["eway"]
        self.customer_id = eway_settings['CUSTOMER_ID']
        if self.test_mode:
            self.rebill_url = REBILL_TEST_URL
            self.hosted_url = HOSTED_TEST_URL
            self.direct_payment_url = DIRECT_PAYMENT_TEST_URL
        else:
            self.rebill_url = REBILL_LIVE_URL
            self.hosted_url = HOSTED_LIVE_URL
            self.direct_payment_url = DIRECT_PAYMENT_LIVE_URL

        self.eway_username = eway_settings['USERNAME']
        self.eway_password = eway_settings['PASSWORD']
Esempio n. 12
0
 def __init__(self):
     self.test_mode = getattr(settings, 'MERCHANT_TEST_MODE', True)
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("eway"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     eway_settings = merchant_settings["eway"]
     if self.test_mode:
         customer_id = eway_settings['TEST_CUSTOMER_ID']
     else:
         customer_id = eway_settings['CUSTOMER_ID']
     self.client = RebillEwayClient(
         test_mode=self.test_mode,
         customer_id=customer_id,
         username=eway_settings['USERNAME'],
         password=eway_settings['PASSWORD'],
         url=self.service_url,
     )
     self.hosted_customer = self.client.client.factory.create("CreditCard")
Esempio n. 13
0
    def __init__(self, *args, **kwargs):
        merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
        if not merchant_settings or not merchant_settings.get("beanstream"):
            raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                       "configured." % self.display_name)
        beanstream_settings = merchant_settings["beanstream"]

        self.supported_cardtypes = [
            Visa, MasterCard, AmericanExpress, Discover
        ]

        hash_validation = False
        if kwargs.get("hash_algorithm",
                      beanstream_settings.get("HASH_ALGORITHM", None)):
            hash_validation = True

        self.beangw = Beanstream(hash_validation=hash_validation,
                                 require_billing_address=kwargs.get(
                                     "require_billing_address", False),
                                 require_cvd=kwargs.get("require_cvd", False))

        merchant_id = kwargs.pop("merchant_id",
                                 beanstream_settings["MERCHANT_ID"])
        login_company = kwargs.pop("login_company",
                                   beanstream_settings["LOGIN_COMPANY"])
        login_user = kwargs.pop("login_user",
                                beanstream_settings["LOGIN_USER"])
        login_password = kwargs.pop("login_password",
                                    beanstream_settings["LOGIN_PASSWORD"])
        kwargs["payment_profile_passcode"] = beanstream_settings.get(
            "PAYMENT_PROFILE_PASSCODE", None)

        if hash_validation:
            if not kwargs.get("hash_algorithm"):
                kwargs["hash_algorithm"] = beanstream_settings[
                    "HASH_ALGORITHM"]
            if not kwargs.get("hashcode"):
                kwargs["hashcode"] = beanstream_settings["HASHCODE"]

        self.beangw.configure(merchant_id, login_company, login_user,
                              login_password, **kwargs)
Esempio n. 14
0
 def __init__(self):
     merchant_settings = getattr(settings, "MERCHANT_SETTINGS")
     if not merchant_settings or not merchant_settings.get("pay_pal"):
         raise GatewayNotConfigured("The '%s' gateway is not correctly "
                                    "configured." % self.display_name)
     pay_pal_settings = merchant_settings["pay_pal"]