• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python satchmo_settings.get_satchmo_setting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中satchmo_store.shop.satchmo_settings.get_satchmo_setting函数的典型用法代码示例。如果您正苦于以下问题:Python get_satchmo_setting函数的具体用法?Python get_satchmo_setting怎么用?Python get_satchmo_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_satchmo_setting函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _cart_xml

    def _cart_xml(self, order):
        template = get_template(self.settings["CART_XML_TEMPLATE"].value)

        ssl = get_satchmo_setting('SSL', default_value=False)
        shopping_url = lookup_url(self.settings, 'satchmo_checkout-success', True, ssl)
        edit_url = lookup_url(self.settings, 'satchmo_cart', True, ssl)
        ctx = Context({"order" : order,
                       "continue_shopping_url" : shopping_url,
                       "edit_cart_url" : edit_url,
                       "currency" : self.settings.CURRENCY_CODE.value,
                       })
        return template.render(ctx)
开发者ID:eyeyunianto,项目名称:satchmo,代码行数:12,代码来源:views.py


示例2: get_satchmo_setting

from django.conf.urls.defaults import patterns
from livesettings import config_get_group
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
ssl = get_satchmo_setting('SSL', default_value=False)

config = config_get_group('PAYMENT_CREDITCARD')
ssl = get_satchmo_setting('SSL', default_value=False)

urlpatterns = patterns('',
    (r'^$', 'satchmoutils.payments.modules.creditcard.views.pay_ship_info', 
        {'SSL': ssl}, 'CREDITCARD_satchmo_checkout-step2'),
    (r'^confirm/$', 'satchmoutils.payments.modules.creditcard.views.confirm_info', 
        {'SSL': ssl}, 'CREDITCARD_satchmo_checkout-step3'),
    (r'^success/$', 'satchmoutils.payments.modules.creditcard.views.success', 
        {'SSL': ssl}, 'CREDITCARD_satchmo_checkout-success'),
    (r'^error/$', 'satchmoutils.payments.modules.creditcard.views.error', 
        {'SSL': ssl}, 'CREDITCARD_satchmo_checkout-error'),
    (r'^confirmorder/$', 'payment.views.confirm.confirm_free_order', 
        {'SSL' : ssl, 'key' : 'CREDITCARD'}, 'CREDITCARD_satchmo_checkout_free-confirm')
)
开发者ID:abstract-open-solutions,项目名称:satchmo-utils,代码行数:20,代码来源:urls.py


示例3: get_satchmo_setting

from django.core.urlresolvers import reverse as url
from django.test import TestCase
from django.test.client import Client
from django.utils.encoding import smart_str
from django.utils.translation import get_language
from django.contrib.sites.models import Site
from keyedcache import cache_delete
from l10n.models import Country
from l10n.utils import moneyfmt
from product.utils import rebuild_pricing
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
from satchmo_store.shop.tests import get_step1_post_data
from django.core.cache import cache

domain = 'http://example.com'
prefix = get_satchmo_setting('SHOP_BASE')
if prefix == '/':
    prefix = ''

class ShopTest(TestCase):
    fixtures = ['l10n-data.yaml', 'sample-store-data.yaml', 'products.yaml', 'test-config.yaml', 'initial_data.yaml']

    def setUp(self):
        # Every test needs a client
        cache_delete()
        self.client = Client()
        self.US = Country.objects.get(iso2_code__iexact = "US")
        current_site = Site.objects.get_current()
        cache_key = "cat-%s-%s" % (current_site.id, get_language())
        cache.delete(cache_key)
        rebuild_pricing()
开发者ID:hnejadi,项目名称:EShop-2,代码行数:31,代码来源:tests.py


示例4: get_satchmo_setting

from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import databrowse
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.views.generic.simple import direct_to_template

from satchmo_store.urls import urlpatterns as satchmo_urls
from satchmo_store.contact.views import ajax_get_state
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
from payment.views.checkout import success

from localsite.views import sfst_success, confirm_info


ssl = get_satchmo_setting('SSL', default_value=True)
handler404 = 'sfst.localsite.views.view_404'
handler500 = 'sfst.localsite.views.view_500'

# Public URLS
urlpatterns = patterns('localsite.views',
    url(r'^$', 'home', {'SSL': ssl}, name='home'),
    # url(r'^cart/$', 'cart', name='cart'),
    url(r'^affiliate-checkout/$', 'affiliate_checkout', {'SSL': ssl}, name='affiliate_checkout'),
    url(r'^product/(?P<tour_type_slug>[\w\-]+)/$', 'product', {'SSL': ssl}, name='product'),
    url(r'^ajax-get-schedule/(?P<tour_type_id>\d+)/$', 'ajax_get_schedule', {'SSL': ssl}, name='ajax_get_schedule'),
    url(r'^ajax-get-schedule-adjust/(?P<tour_type_id>\d+)/$', 'ajax_get_schedule', {'SSL': ssl}, name='ajax_get_schedule_adjust'),
    url(r'^accounts/dispatcher/', 'login_dispatcher', {'SSL': ssl}, name='login_dispatcher'),
    url(r'^clear-affiliate', 'clear_affiliate', {'SSL': ssl}, name='clear_affiliate'),
    url(r'^get-city-country-details/$', 'zip_to_city_country', {'SSL': ssl}, name='zip_to_city_country'),
    url(r'^customer-adjust/(?P<order_hash>\w+)/$', 'customer_order_detail',
开发者ID:sfshuttletours,项目名称:sfst,代码行数:31,代码来源:urls.py


示例5: confirm_info

def confirm_info(request):
    payment_module = config_get_group("PAYMENT_SERMEPA")

    try:
        order = Order.objects.from_request(request)
    except Order.DoesNotExist:
        url = lookup_url(payment_module, "satchmo_checkout-step1")
        return HttpResponseRedirect(url)

    tempCart = Cart.objects.from_request(request)
    if tempCart.numItems == 0:
        template = lookup_template(payment_module, "shop/checkout/empty_cart.html")
        return render_to_response(template, context_instance=RequestContext(request))

    # Check if the order is still valid
    if not order.validate(request):
        context = RequestContext(request, {"message": _("Your order is no longer valid.")})
        return render_to_response("shop/404.html", context_instance=context)

    # Check if we are in test or real mode
    live = payment_module.LIVE.value
    if live:
        post_url = payment_module.POST_URL.value
        signature_code = payment_module.MERCHANT_SIGNATURE_CODE.value
        terminal = payment_module.MERCHANT_TERMINAL.value
    else:
        post_url = payment_module.POST_TEST_URL.value
        signature_code = payment_module.MERCHANT_TEST_SIGNATURE_CODE.value
        terminal = payment_module.MERCHANT_TEST_TERMINAL.value

    # SERMEPA system does not accept multiple payment attempts with the same ID, even
    # if the previous one has never been finished. The worse is that it does not display
    # any message which could be understood by an end user.
    #
    # If user goes to SERMEPA page and clicks 'back' button (e.g. to correct contact data),
    # the next payment attempt will be rejected.
    #
    # To provide higher probability of ID uniqueness, we add mm:ss timestamp part
    # to the order id, separated by 'T' character in the following way:
    #
    #   ID: oooooooTmmss
    #   c:  123456789012
    #
    # The Satchmo's Order number is therefore limited to 10 million - 1.
    now = timezone.now()
    xchg_order_id = "%07dT%02d%02d" % (order.id, now.minute, now.second)

    amount = "%d" % (order.balance * 100,)  # in cents

    template = lookup_template(payment_module, "shop/checkout/sermepa/confirm.html")

    url_callback = _resolve_local_url(
        payment_module, payment_module.MERCHANT_URL_CALLBACK, ssl=get_satchmo_setting("SSL")
    )
    url_ok = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_OK)
    url_ko = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_KO)

    if payment_module.EXTENDED_SIGNATURE.value:
        signature_data = "".join(
            map(
                str,
                (
                    amount,
                    xchg_order_id,
                    payment_module.MERCHANT_FUC.value,
                    payment_module.MERCHANT_CURRENCY.value,
                    "0",  # TransactionType
                    url_callback,
                    signature_code,
                ),
            )
        )
    else:
        signature_data = "".join(
            map(
                str,
                (
                    amount,
                    xchg_order_id,
                    payment_module.MERCHANT_FUC.value,
                    payment_module.MERCHANT_CURRENCY.value,
                    signature_code,
                ),
            )
        )

    signature = sha1(signature_data).hexdigest()
    ctx = {
        "live": live,
        "post_url": post_url,
        "MERCHANT_CURRENCY": payment_module.MERCHANT_CURRENCY.value,
        "MERCHANT_FUC": payment_module.MERCHANT_FUC.value,
        "terminal": terminal,
        "MERCHANT_TITULAR": payment_module.MERCHANT_TITULAR.value,
        "url_callback": url_callback,
        "url_ok": url_ok,
        "url_ko": url_ko,
        "order": order,
        "xchg_order_id": xchg_order_id,
        "amount": amount,
#.........这里部分代码省略.........
开发者ID:kidaa30,项目名称:pops,代码行数:101,代码来源:views.py


示例6: get_satchmo_setting

from django.conf.urls.defaults import patterns
from satchmo_store.shop.satchmo_settings import get_satchmo_setting

ssl = get_satchmo_setting("SSL", default_value=False)

urlpatterns = patterns(
    "",
    (r"^$", "satchmo.payment.paybox.views.pay_ship_info", {"SSL": ssl}, "PAYBOX_satchmo_checkout-step2"),
    (
        r"^confirm/$",
        "site_v1.ext.satchmo.payment.paybox.views.confirm_info",
        {"SSL": ssl},
        "PAYBOX_satchmo_checkout-step3",
    ),
    (r"^success/$", "payment.views.checkout.success", {"SSL": ssl}, "PAYBOX_satchmo_checkout-success"),
    (
        r"^failure/$",
        "django.views.generic.simple.direct_to_template",
        {"SSL": ssl, "template": "shop/checkout/failure.html"},
        "PAYBOX_satchmo_checkout-failure",
    ),
    (
        r"^cancelled/$",
        "django.views.generic.simple.direct_to_template",
        {"SSL": ssl, "template": "shop/checkout/cancelled.html"},
        "PAYBOX_satchmo_checkout-cancelled",
    ),
    (r"^cb/$", "satchmo.payment.paybox.views.cb", {"SSL": ssl}, "PAYBOX_satchmo_checkout-cb"),
    (
        r"^confirmorder/$",
        "payment.views.confirm.confirm_free_order",
开发者ID:quinode,项目名称:satchmo-payment-paybox,代码行数:31,代码来源:urls.py


示例7: confirm_info

def confirm_info(request):
    payment_module = config_get_group('PAYMENT_DOTPAY')

    try:
        order = Order.objects.from_request(request)
    except Order.DoesNotExist:
        url = lookup_url(payment_module, 'satchmo_checkout-step1')
        return HttpResponseRedirect(url)

    tempCart = Cart.objects.from_request(request)
    if tempCart.numItems == 0:
        template = lookup_template(payment_module, 'shop/checkout/empty_cart.html')
        return render_to_response(template,
                                  context_instance=RequestContext(request))

    # Check if the order is still valid
    if not order.validate(request):
        context = RequestContext(request, {'message': _('Your order is no longer valid.')})
        return render_to_response('shop/404.html', context_instance=context)

    # Check if we are in test or real mode
    live = payment_module.LIVE.value
    if live:
        post_url = payment_module.POST_URL.value
        signature_code = payment_module.MERCHANT_SIGNATURE_CODE.value
        terminal = payment_module.MERCHANT_TERMINAL.value
    else:
        post_url = payment_module.POST_TEST_URL.value
        signature_code = payment_module.MERCHANT_TEST_SIGNATURE_CODE.value
        terminal = payment_module.MERCHANT_TEST_TERMINAL.value

    # DOTPAY system does not accept multiple payment attempts with the same ID, even
    # if the previous one has never been finished. The worse is that it does not display
    # any message which could be understood by an end user.
    #
    # If user goes to DOTPAY page and clicks 'back' button (e.g. to correct contact data),
    # the next payment attempt will be rejected.
    #
    # To provide higher probability of ID uniqueness, we add mm:ss timestamp part
    # to the order id, separated by 'T' character in the following way:
    #
    #   ID: oooooooTmmss
    #   c:  123456789012
    #
    # The Satchmo's Order number is therefore limited to 10 million - 1.
    now = datetime.now()
    xchg_order_id = "%07dT%02d%02d" % (order.id, now.minute, now.second)

#    amount = "%d" % (order.balance * 100,)    # in cents
    amount = order.balance

    template = lookup_template(payment_module, 'shop/checkout/dotpay/confirm.html')

    url_callback = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_CALLBACK, ssl=get_satchmo_setting('SSL'))
    url_ok = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_OK)
    url_ko = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_KO)

    if payment_module.EXTENDED_SIGNATURE.value:
        signature_data = ''.join(
                map(str, (
                        amount,
                        xchg_order_id,
                        payment_module.DOTPAY_DOTID.value,
                        payment_module.MERCHANT_CURRENCY.value,
                        "0", #TransactionType
                        url_callback,
                        signature_code,
                        )
                   )
                )
    else:
        signature_data = ''.join(
                map(str, (
                        amount,
                        xchg_order_id,
                        payment_module.DOTPAY_DOTID.value,
                        payment_module.MERCHANT_CURRENCY.value,
                        signature_code,
                        )
                   )
                )

    signature = sha1(signature_data).hexdigest()
    ctx = {
        'live': live,
        'post_url': post_url,
        'MERCHANT_CURRENCY': payment_module.MERCHANT_CURRENCY.value,
        'DOTPAY_DOTID': payment_module.DOTPAY_DOTID.value,
        'terminal': terminal,
        'MERCHANT_TITULAR': payment_module.MERCHANT_TITULAR.value,
        'url_callback': url_callback,
        'url_ok': url_ok,
        'url_ko': url_ko,
        'order': order,
        'xchg_order_id' : xchg_order_id,
        'amount': amount,
        'signature': signature,
        'default_view_tax': config_value('TAX', 'DEFAULT_VIEW_TAX'),
        'contact':order.contact,
    }
#.........这里部分代码省略.........
开发者ID:Coalas,项目名称:gedanumShop,代码行数:101,代码来源:views.py


示例8: confirm_info

def confirm_info(request):
    payment_module = config_get_group('PAYMENT_PAGOSONLINE')

    try:
        order = Order.objects.from_request(request)
        get_buyer_email = Contact.objects.filter(id=order.contact_id)
    except Order.DoesNotExist:
        url = lookup_url(payment_module, 'satchmo_checkout-step1')
        return HttpResponseRedirect(url)

    tempCart = Cart.objects.from_request(request)
    if tempCart.numItems == 0:
        template = lookup_template(payment_module, 'shop/checkout/empty_cart.html')
        return render_to_response(template,
                                  context_instance=RequestContext(request))

    # Check if the order is still valid
    if not order.validate(request):
        context = RequestContext(request, {'message': _('Your order is no longer valid.')})
        return render_to_response('shop/404.html', context_instance=context)

    # Check if we are in test or real mode
    live = payment_module.LIVE.value
    if live:
        post_url = payment_module.POST_URL.value
        prueba = 0
    else:
        post_url = payment_module.POST_TEST_URL.value
        prueba = 1
    #
    # PAGOSONLINE system does not accept multiple payment attempts with the same refVenta, even
    # if the previous one has never been finished. The worse is that it does not display
    # any message which could be understood by an end user.
    #
    # If user goes to PAGOSONLINE page and clicks 'back' button (e.g. to correct contact data),
    # the next payment attempt will be rejected.
    #
    # To provide higher probability of refVenta uniqueness, we add YYYY:DD:MM:hh:mm:ss timestamp part
    # to the order id, separated by 'T' character in the following way:
    #
    #   refVenta: xxxxxxxTYYYYDDMMHHMMSS
    #
    now = datetime.now()
    xchg_order_id = "%dT%04d%02d%02d%02d%02d%02d" % (order.id, now.year, now.day, now.month, now.hour, now.minute, now.second)

    signature_code = payment_module.MERCHANT_SIGNATURE_CODE.value
    userId = payment_module.MERCHANT_USERID_CODE.value
    amount = "%.2f" % order.balance
    log.debug("Amount for confirm Info %s" % amount)
    coin = payment_module.MERCHANT_CURRENCY.value
    signature_data = '~'.join(
            map(str, (
                    signature_code,
                    userId,
                    xchg_order_id,
                    amount,
                    coin,
                    )))

    try:
        cartnumber = request.session['cart']
    except KeyError:
        log.debug("No cart number found %s", request.session)
    
    signature=md5(signature_data).hexdigest()
    template = lookup_template(payment_module, 'shop/checkout/pagosonline/confirm.html')

    url_callback = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_CALLBACK, ssl=get_satchmo_setting('SSL'))
    url_ans = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_OK)
#    url_ko = _resolve_local_url(payment_module, payment_module.MERCHANT_URL_KO)
    
    try:
        request.user.email
        emailComprador = request.user.email
    except:
        emailComprador = get_buyer_email[0].email

    float_balance = float(order.balance)
    no_iva = float_balance/1.16
    iva = round(0.16*no_iva,2)
    
    log.debug("IVA = %f" % iva)

    ctx = {
        'live': live,
        'post_url': post_url,
        'coin': payment_module.MERCHANT_CURRENCY.value,
        'url_callback': url_callback,
        'url_ans': url_ans,
        'usuarioId': userId,
	    'order': order,
        'xchg_order_id': xchg_order_id,
        'amount': amount,
        'iva': iva,
        'signature': signature,
	    'prueba': prueba,
        'emailComprador': emailComprador,
        'default_view_tax': config_value('TAX', 'DEFAULT_VIEW_TAX'),
    }

#.........这里部分代码省略.........
开发者ID:angvp,项目名称:pagosonline,代码行数:101,代码来源:views.py



注:本文中的satchmo_store.shop.satchmo_settings.get_satchmo_setting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python dynamic.lookup_template函数代码示例发布时间:2022-05-27
下一篇:
Python configuration.config_value函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap