コード例 #1
0
    def testGetPriceForCustomer(self):
        """
        """
        pp = IPaymentPriceManagement(self.shop)
        price_gross = pp.getPriceGross()

        self.assertEqual(price_gross, 100.0)
コード例 #2
0
 def testGetPriceForCustomer(self):
     """
     """
     pp = IPaymentPriceManagement(self.shop)
     price_gross = pp.getPriceGross()
     
     self.assertEqual(price_gross, 100.0)
コード例 #3
0
ファイル: order_preview.py プロジェクト: Easyshop/Easyshop
 def getPaymentMethodInfo(self):
     """
     """
     # method
     customer = ICustomerManagement(self.context).getAuthenticatedCustomer()
     selected_payment_method = customer.selected_payment_method
     
     pm = IPaymentMethodManagement(self.context)
     method = pm.getPaymentMethod(selected_payment_method)
     
     # price
     pp = IPaymentPriceManagement(self.context)
     payment_price = pp.getPriceGross()
     cm = ICurrencyManagement(self.context)
     price = cm.priceToString(payment_price)
     
     return {
         "type"    : method.portal_type,
         "title"   : method.Title(),
         "price"   : price,
         "display" : payment_price != 0,
     }
コード例 #4
0
    def getPaymentMethodInfo(self):
        """
        """
        # method
        customer = ICustomerManagement(self.context).getAuthenticatedCustomer()
        selected_payment_method = customer.selected_payment_method

        pm = IPaymentMethodManagement(self.context)
        method = pm.getPaymentMethod(selected_payment_method)

        # price
        pp = IPaymentPriceManagement(self.context)
        payment_price = pp.getPriceGross()
        cm = ICurrencyManagement(self.context)
        price = cm.priceToString(payment_price)

        return {
            "type": method.portal_type,
            "title": method.Title(),
            "price": price,
            "display": payment_price != 0,
        }