当前位置: 首页>>代码示例>>Python>>正文


Python dynamic.lookup_template函数代码示例

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


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

示例1: confirm_info

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

    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 and not order.is_partially_paid:
        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)

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

    processor_module = payment_module.MODULE.load_module('processor')
    processor = processor_module.PaymentProcessor(payment_module)
    
    pending_payment = processor.create_pending_payment(order=order)
    payment = pending_payment.capture
    
    log.debug('Creating payment %s for order %s', payment, order)
    
    success_url = reverse_full_url('OGONE_satchmo_checkout-success')
    failure_url = reverse_full_url('OGONE_satchmo_checkout-failure')
    homeurl = reverse_full_url('satchmo_shop_home')
    catalogurl = reverse_full_url('satchmo_category_index')
    
    # Get Ogone settings from Satchmo
    settings = get_ogone_settings()
    
    context = get_ogone_request(payment, 
                                settings,
                                accepturl=success_url,
                                cancelurl=failure_url,
                                declineurl=failure_url,
                                exceptionurl=failure_url,
                                homeurl=homeurl,
                                catalogurl=catalogurl,
                                language=getattr(request, 'LANGUAGE_CODE', 'en_US'))
    
    context.update({'order': order})
    
    return render_to_response(template, context, RequestContext(request))
开发者ID:curaloucura,项目名称:satchmo-payment-ogone,代码行数:52,代码来源:views.py

示例2: confirm_info

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

    if not 'orderID' in request.session:
        url = lookup_url(payment_module, 'satchmo_checkout-step1')
        return http.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, RequestContext(request))
            
    try:
        order = Order.objects.from_request(request)

    except Order.DoesNotExist:
        order = None

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

    live = payment_live(payment_module)
    gcart = GoogleCart(order, payment_module, live)
    log.debug("CART:\n%s", gcart.cart_xml)
    template = lookup_template(payment_module, 'shop/checkout/confirm.html')

    if live:
        merchant_id = payment_module.MERCHANT_ID.value
        url_template = payment_module.POST_URL.value
    else:
        merchant_id = payment_module.MERCHANT_TEST_ID.value
        url_template = payment_module.POST_TEST_URL.value
        
    post_url =  url_template % {'MERCHANT_ID' : merchant_id}
    default_view_tax = config_value('TAX', 'DEFAULT_VIEW_TAX')
    
    ctx = RequestContext(request, {
        'order': order,
        'post_url': post_url,
        'default_view_tax': default_view_tax,
        'google_cart' : gcart.encoded_cart(),
        'google_signature' : gcart.encoded_signature(),
        'PAYMENT_LIVE' : live
    })

    return render_to_response(template, ctx)
开发者ID:jtslade,项目名称:satchmo-svn,代码行数:48,代码来源:views.py

示例3: one_step

def one_step(request):
    # First verify that the customer exists
    try:
        contact = Contact.objects.from_request(request, create=False)
    except Contact.DoesNotExist:
        url = lookup_url(payment_config, "satchmo_checkout-step1")
        return HttpResponseRedirect(url)
    # Verify we still have items in the cart
    tempCart = Cart.objects.from_request(request)
    if tempCart.numItems == 0:
        template = lookup_template(payment_config, "shop/checkout/empty_cart.html")
        return render_to_response(template, context_instance=RequestContext(request))

    # Create a new order
    newOrder = Order(contact=contact)
    pay_ship_save(newOrder, tempCart, contact, shipping="", discount="", notes="")

    request.session["orderID"] = newOrder.id

    processor = get_processor_by_key("PAYMENT_REWARD_POINTS")
    processor.prepare_data(newOrder)
    processor_result = processor.process(newOrder)

    if processor_result.success:
        tempCart.empty()
        return success(request)
    else:
        return failure(request)
开发者ID:ubiquitousthey,项目名称:django-rewards,代码行数:28,代码来源:views.py

示例4: pay_ship_info

def pay_ship_info(request):
    template = 'satchmo_stripe/pay_ship.html'
    payment_module = stripe
    form_handler = stripe_pay_ship_process_form
    result = payship.pay_ship_info_verify(request, payment_module)

    if not result[0]:
        return result[1]

    contact = result[1]
    working_cart = result[2]

    success, form = form_handler(request, contact, working_cart, payment_module)
    if success:
        return form

    template = lookup_template(payment_module, template)
    live = gateway_live(payment_module)

    ctx = RequestContext(request, {
        'form': form,
        'PAYMENT_LIVE': live,        
        })

    return render_to_response(template, context_instance=ctx)
开发者ID:buddylindsey,项目名称:satchmo-stripe,代码行数:25,代码来源:views.py

示例5: one_step

def one_step(request):
    payment_module = config_get_group('PAYMENT_AUTOSUCCESS')

    #First verify that the customer exists
    try:
        contact = Contact.objects.from_request(request, create=False)
    except Contact.DoesNotExist:
        url = lookup_url(payment_module, 'satchmo_checkout-step1')
        return HttpResponseRedirect(url)
    #Verify we still have items in the cart
    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))

    # Create a new order
    newOrder = Order(contact=contact)
    pay_ship_save(newOrder, tempCart, contact,
        shipping="", discount="", notes="")
        
    request.session['orderID'] = newOrder.id
    
    processor = get_processor_by_key('PAYMENT_AUTOSUCCESS')
    processor.prepare_data(newOrder)
    payment = processor.process(newOrder)
        
    tempCart.empty()
    success = lookup_url(payment_module, 'satchmo_checkout-success')
    return HttpResponseRedirect(success)
开发者ID:eyeyunianto,项目名称:satchmo,代码行数:30,代码来源:views.py

示例6: pay_ship_render_form

def pay_ship_render_form(request, form, template, payment_module, cart):
    template = lookup_template(payment_module, template)
            
    ctx = RequestContext(request, {
        'form': form,
        'PAYMENT_LIVE': gateway_live(payment_module),
        })
    return render_to_response(template, context_instance=ctx)
开发者ID:34,项目名称:T,代码行数:8,代码来源:payship.py

示例7: confirm_secure3d

def confirm_secure3d(request, secure3d_template='shop/checkout/sagepay/secure3d_form.html', 
    confirm_template='shop/checkout/confirm.html', extra_context={}):
    """Handles confirming an order and processing the charges when secured by secure3d.
 
    """
    payment_module = config_get_group('PAYMENT_SAGEPAY')
    controller = confirm.ConfirmController(request, payment_module, extra_context=extra_context)
    controller.template['CONFIRM'] = confirm_template
    if not controller.sanity_check():
        return controller.response
    
    auth3d = request.session.get('3D', None)
    if not auth3d:
        controller.processorMessage = _('3D Secure transaction expired. Please try again.')

    else:
        if request.method == "POST":
            returnMD = request.POST.get('MD', None)
            if not returnMD:
                template = lookup_template(payment_module, secure3d_template)
                ctx = RequestContext(request, {'order': controller.order, 'auth': auth3d })
                return render_to_response(template, context_instance=ctx)

            elif returnMD == auth3d['MD']:
                pares = request.POST.get('PaRes', None)
                controller.processor.prepare_data(controller.order)
                controller.processor.prepare_data3d(returnMD, pares)
                if controller.process():
                    return controller.onSuccess(controller)
                else:
                    controller.processorMessage = _('3D Secure transaction was not approved by payment gateway. Please contact us.')
        else:
            template = lookup_template(payment_module, secure3d_template)
            ctx =RequestContext(request, {
                'order': controller.order, 'auth': auth3d 
                })
            return render_to_response(template, context_instance=ctx)

    return secure3d_form_handler(controller)
开发者ID:eyeyunianto,项目名称:satchmo,代码行数:39,代码来源:views.py

示例8: pay_ship_render_form

def pay_ship_render_form(request, form, template, payment_module, cart):
    template = lookup_template(payment_module, template)
    
    if cart.numItems > 0:
        products = [item.product for item in cart.cartitem_set.all()]
        sale = find_best_auto_discount(products)
    else:
        sale = None
        
    ctx = RequestContext(request, {
        'form': form,
        'sale' : sale,
        'PAYMENT_LIVE': payment_live(payment_module),
        })
    return render_to_response(template, ctx)
开发者ID:jtslade,项目名称:satchmo-svn,代码行数:15,代码来源:payship.py

示例9: pay_ship_info

def pay_ship_info(request):
    template = 'satchmo_stripe/pay_ship.html'
    payment_module = stripe_config
    form_handler = stripe_pay_ship_process_form
    result = payship.pay_ship_info_verify(request, payment_module)

    if not result[0]:
        return result[1]

    contact = result[1]
    working_cart = result[2]

    success, form = form_handler(request, contact, working_cart, payment_module)
    if success:
        return form

    template = lookup_template(payment_module, template)
    live = gateway_live(payment_module)

    last4=''
    cc_type=''
    user = threadlocals.get_current_user()
    if user and user.is_authenticated:
      stripe_id = utils.check_stripe_customer(threadlocals.get_current_user())
      if stripe_id:
        customer = utils.get_customer(stripe_id)
        if customer:
          last4 = customer.active_card.last4
          cc_type = customer.active_card.type
          if utils.card_is_about_to_expire(customer.active_card):
#Raise message telling user that the card is about to expire
            message = "The %s card ending in %s will expire in less than %d days, please enter a new card" % (cc_type,last4,payment_module.MIN_DAYS.value)
            messages.add_message(request, messages.WARNING, message)
            cc_type = ''
            last4=''


    ctx = RequestContext(request, {
        'form': form,
        'PAYMENT_LIVE': live,        
        'saved_card' : last4,
        'cc_type' : cc_type,
        'show_save_option' : payment_module.CAPTURE.value,
        })

    return render_to_response(template, context_instance=ctx)
开发者ID:trwalzer,项目名称:satchmo-stripe,代码行数:46,代码来源:views.py

示例10: __call__

    def __call__(self, request):
        #First verify that the customer exists
        try:
            contact = Contact.objects.from_request(request, create=False)
        except Contact.DoesNotExist:
            url = lookup_url(self.payment_module, 'satchmo_checkout-step1')
            return HttpResponseRedirect(url)
        #Verify we still have items in the cart
        tempCart = Cart.objects.from_request(request)
        if tempCart.numItems == 0:
            template = lookup_template(
                self.payment_module,
                'shop/checkout/empty_cart.html'
            )
            return render_to_response(
                template, context_instance=RequestContext(request)
            )
            
        data = {}
        if request.method == 'POST':
            data['discount'] = request.post.get('discount_code')
        
        
        success = lookup_url(
            self.payment_module,
            '%s_satchmo_checkout-success' % self.processor.key,
        )
        
        order = get_or_create_order(request, tempCart, contact, data)
        
        self.preprocess_order(order)
        
        # Add status
        order.add_status('New', _("Payment needs to be confirmed"))
        # Process payment
        self.processor.prepare_data(order)
        self.processor.process(order)
        tempCart.empty()

        self.postprocess_order(order)
        order.save()

        return HttpResponseRedirect(success)
开发者ID:abstract-open-solutions,项目名称:satchmo-utils,代码行数:43,代码来源:views.py

示例11: pay_ship_info_verify

def pay_ship_info_verify(request, payment_module):
    """Verify customer and cart.
    Returns:
    True, contact, cart on success
    False, destination of failure
    """
    # Verify that the customer exists.
    try:
        contact = Contact.objects.from_request(request, create=False)
    except Contact.DoesNotExist:
        log.debug('No contact, returning to step 1 of checkout')
        url = lookup_url(payment_module, 'satchmo_checkout-step1')
        return (False, http.HttpResponseRedirect(url))

    # Verify that we still have items in the cart.
    tempCart = Cart.objects.from_request(request)
    if tempCart.numItems == 0:
        template = lookup_template(payment_module, 'shop/checkout/empty_cart.html')
        return (False, render_to_response(template, RequestContext(request)))
            
    return (True, contact, tempCart)
开发者ID:hnejadi,项目名称:xerobis,代码行数:21,代码来源:payship.py

示例12: _get_shipping_choices

def _get_shipping_choices(request, paymentmodule, cart, contact, default_view_tax=False):
    """Iterate through legal shipping modules, building the list for display to the user.
    
    Returns the shipping choices list, along with a dictionary of shipping choices, useful
    for building javascript that operates on shipping choices.
    """
    shipping_options = []
    shipping_dict = {}
    
    if not cart.is_shippable:
        methods = [shipping_method_by_key('NoShipping'),]
    else:
        methods = shipping_methods()
    
    for method in methods:
        method.calculate(cart, contact)
        if method.valid():
            template = lookup_template(paymentmodule, 'shipping/options.html')
            t = loader.get_template(template)
            shipcost = method.cost()
            shipping_tax = None
            taxed_shipping_price = None
            if config_value_safe('TAX','TAX_SHIPPING', False):
                shipping_tax = TaxClass.objects.get(title=config_value('TAX', 'TAX_CLASS'))
                taxer = _get_taxprocessor(request)
                total = shipcost + taxer.by_price(shipping_tax, shipcost)
                taxed_shipping_price = moneyfmt(total)
            c = RequestContext(request, {
                'amount': shipcost,
                'description' : method.description(),
                'method' : method.method(),
                'expected_delivery' : method.expectedDelivery(),
                'default_view_tax' : default_view_tax,
                'shipping_tax': shipping_tax,
                'taxed_shipping_price': taxed_shipping_price})
            shipping_options.append((method.id, t.render(c)))
            shipping_dict[method.id] = shipcost
    
    return shipping_options, shipping_dict
开发者ID:hnejadi,项目名称:xerobis,代码行数:39,代码来源:forms.py

示例13: confirm_info

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

    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 and not order.is_partially_paid:
        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)

    template = lookup_template(
        payment_module, 
        'shop/checkout/creditcard/confirm.html'
    )
    if payment_module.LIVE.value:
        log.debug("live order on %s", payment_module.KEY.value)
        url = payment_module.POST_URL.value
        account = payment_module.MERCHANT_ID.value
    else:
        url = payment_module.POST_TEST_URL.value
        account = payment_module.MERCHANT_TEST_ID.value

    try:
        address = lookup_url(payment_module,
            payment_module.RETURN_ADDRESS.value, include_server=True)
    except urlresolvers.NoReverseMatch:
        address = payment_module.RETURN_ADDRESS.value
    
    processor_module = payment_module.MODULE.load_module('processor')
    processor = processor_module.PaymentProcessor(payment_module)
    processor.create_pending_payment(order=order)
    default_view_tax = config_value('TAX', 'DEFAULT_VIEW_TAX') 
  
    recurring = None
    order_items = order.orderitem_set.all()
    for item in order_items:
        if item.product.is_subscription:
            recurring = {
                'product':item.product, 
                'price':item.product.price_set.all()[0].price.quantize(Decimal('.01'))
            }
            trial0 = recurring['product'].subscriptionproduct.get_trial_terms(0)
            if len(order_items) > 1 or trial0 is not None \
                        or recurring['price'] < order.balance:
                recurring['trial1'] = {'price': order.balance,}
                if trial0 is not None:
                    recurring['trial1']['expire_length'] = trial0.expire_length
                    recurring['trial1']['expire_unit'] = trial0.expire_unit[0]
                trial1 = recurring['product'].subscriptionproduct.get_trial_terms(1)
                if trial1 is not None:
                    recurring['trial2']['expire_length'] = trial1.expire_length
                    recurring['trial2']['expire_unit'] = trial1.expire_unit[0]
                    recurring['trial2']['price'] = trial1.price

    gpc = GestPayCrypt()
    
    gpc.SetShopLogin(account)
    gpc.SetShopTransactionID(str(order.id))
    gpc.SetAmount("%.2f" % order.total)

    a = gpc.GetShopLogin()
    b = ''
    if gpc.Encrypt() == None:
        print "Authorization Failed"
    else:
        b = gpc.GetEncryptedString()
             
    encrypt = url
    params = "?a=%s&b=%s" % (a, b)
    
    url = "%s%s" % (encrypt, params)
    
    ctx = RequestContext(request, {
     'order': order,
     'post_url': url,
     'default_view_tax': default_view_tax, 
     'business': account,
     'currency_code': payment_module.CURRENCY_CODE.value,
     'return_address': address,
     'invoice': order.id,
     'subscription': recurring,
     'PAYMENT_LIVE' : gateway_live(payment_module)
    })

    return render_to_response(template, context_instance=ctx)
开发者ID:abstract-open-solutions,项目名称:satchmo-utils,代码行数:99,代码来源:views.py

示例14: _get_shipping_choices

def _get_shipping_choices(request, paymentmodule, cart, contact, default_view_tax=False, order=None):
    """Iterate through legal shipping modules, building the list for display to the user.

    Returns the shipping choices list, along with a dictionary of shipping choices, useful
    for building javascript that operates on shipping choices.
    """
    shipping_options = []
    shipping_dict = {}
    rendered = {}
    if not order:
        try:
            order = Order.objects.from_request(request)
        except Order.DoesNotExist:
            pass

    discount = None
    if order:
        try:
            discount = Discount.objects.by_code(order.discount_code)
        except Discount.DoesNotExist:
            pass

    if not cart.is_shippable:
        methods = [shipping_method_by_key('NoShipping'),]
    else:
        methods = shipping_methods()

    tax_shipping = config_value_safe('TAX','TAX_SHIPPING', False)
    shipping_tax = None

    if tax_shipping:
        taxer = _get_taxprocessor(request)
        shipping_tax = TaxClass.objects.get(title=config_value('TAX', 'TAX_CLASS'))

    for method in methods:
        method.calculate(cart, contact)
        if method.valid():
            template = lookup_template(paymentmodule, 'shipping/options.html')
            t = loader.get_template(template)
            shipcost = finalcost = method.cost()

            if discount and order:
                order.shipping_cost = shipcost
                discount.calc(order)
                shipdiscount = discount.item_discounts.get('Shipping', 0)
            else:
                shipdiscount = 0

            # set up query to determine shipping price to show
            shipprice = Price()
            shipprice.price = shipcost
            shipadjust = PriceAdjustmentCalc(shipprice)
            if shipdiscount:
                shipadjust += PriceAdjustment('discount', _('Discount'), shipdiscount)

            satchmo_shipping_price_query.send(cart, adjustment=shipadjust)
            shipdiscount = shipadjust.total_adjustment()

            if shipdiscount:
                finalcost -= shipdiscount

            shipping_dict[method.id] = {'cost' : shipcost, 'discount' : shipdiscount, 'final' : finalcost}

            taxed_shipping_price = None
            if tax_shipping:
                taxcost = taxer.by_price(shipping_tax, finalcost)
                total = finalcost + taxcost
                taxed_shipping_price = moneyfmt(total)
                shipping_dict[method.id]['taxedcost'] = total
                shipping_dict[method.id]['tax'] = taxcost

            c = RequestContext(request, {
                'amount': finalcost,
                'description' : method.description(),
                'method' : method.method(),
                'expected_delivery' : method.expectedDelivery(),
                'default_view_tax' : default_view_tax,
                'shipping_tax': shipping_tax,
                'taxed_shipping_price': taxed_shipping_price})
            rendered[method.id] = t.render(c)

    #now sort by price, low to high
    sortme = [(value['cost'], key) for key, value in shipping_dict.items()]
    sortme.sort()

    shipping_options = [(key, rendered[key]) for cost, key in sortme]

    shipping_choices_query.send(sender=cart, cart=cart,
        paymentmodule=paymentmodule, contact=contact,
        default_view_tax=default_view_tax, order=order,
        shipping_options = shipping_options,
        shipping_dict = shipping_dict)
    return shipping_options, shipping_dict
开发者ID:mpango,项目名称:satchmo,代码行数:93,代码来源:forms.py

示例15: confirm_info

def confirm_info(request):
    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 and not order.is_partially_paid:
        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)
    # from here on just setting and calling variables
    template = lookup_template(payment_module, 'shop/checkout/paysbuy/confirm.html')
    if payment_module.LIVE.value:
        log.debug("live order on %s", payment_module.KEY.value)
        url = payment_module.CONNECTION.value 
        psb = payment_module.PSB.value
        account = payment_module.BIZ.value
        secure_code = payment_module.SECURE_CODE.value
    else:
        url = payment_module.CONNECTION_TEST.value
        psb = payment_module.PSB_TEST.value
        account = payment_module.BIZ_TEST.value
        secure_code = payment_module.SECURE_CODE_TEST.value
    try:
        address = lookup_url(payment_module,
            payment_module.FRONT_URL.value, include_server=True)
    except urlresolvers.NoReverseMatch:
        address = payment_module.FRONT_URL.value
    try:
        cart = Cart.objects.from_request(request)
    except:
        cart = None
    try:
        contact = Contact.objects.from_request(request)
    except:
        contact = None
    if cart and contact:
        cart.customer = contact
        log.debug(':::Updating Cart %s for %s' % (cart, contact))
        cart.save()
    if payment_module.OPT_FIX_REDIRECT.value:
        opt_fix_redirect = '1'
    else:
        opt_fix_redirect= ''
    if  payment_module.OPT_FIX_METHOD.value:
        opt_fix_method = '1'
    else:
        opt_fix_method = ''
    
    total_plus_tax = 0
    for o in order.orderitem_set.all():
        total_plus_tax = total_plus_tax + o.total_with_tax
    processor_module = payment_module.MODULE.load_module('processor')
    processor = processor_module.PaymentProcessor(payment_module)
    processor.create_pending_payment(order=order)
    ship_tax_total = total_plus_tax + order.shipping_cost

    psb_post_out_dict = {
     'order': order,
     'post_url': url,
     'psb': psb[:10],
     'biz': account[:200],
     'secure_code': secure_code[:200],
     'amount': ship_tax_total,
     'paypal': ""[:2],
     'commission': payment_module.COMMISSION_CODE.value[:200],
     'default_pay_method': payment_module.PAY_METHOD.value[:1],
     'currencyCode': payment_module.CURRENCY_CODE.value,
     'lang': payment_module.LANGUAGE.value[:1],
     'postURL': address[:500],
     'reqURL': payment_module.BACK_URL.value[:500],
     'opt_fix_redirect': opt_fix_redirect[:1],
     'opt_fix_method': opt_fix_method[:1],
     'opt_name': contact.full_name[:200],
     'opt_email': contact.email[:200],
     'opt_mobile': str(contact.primary_phone)[:200],
     'opt_address': str(contact.shipping_address)[:200],
     'opt_detail': ""[:200],
     'invoice': str(order.id)[:200],
     'itm': "Thailand Furniture Purchase"[:200],
     'PAYMENT_LIVE' : payment_module.LIVE.value,
     'OrderPaidInFull': order.paid_in_full,
    }

    ctx = RequestContext(request, psb_post_out_dict)
    if not payment_module.LIVE.value:
        if order.notes:
            admin_notes = order.notes + u'\n'
        else:
            admin_notes = ""
        order.notes = admin_notes + 'TEST' + u'\n'
    order.add_status(status='New', notes=_("Payment sent to Paysbuy."))
#.........这里部分代码省略.........
开发者ID:MorganShorter,项目名称:satchmo-payment-module-paysbuy,代码行数:101,代码来源:views.py


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