Example #1
0
    def _isValid(self, name):
        """Returns true if the payment method with given name is valid.
        """
        spm = IPaymentMethodManagement(self.context)
        dd = spm.getPaymentMethod(name)

        if dd is None or IValidity(dd).isValid() == False:
            return False
        else:
            return True
Example #2
0
 def _isValid(self, name):
     """Returns true if the payment method with given name is valid.
     """
     spm = IPaymentMethodManagement(self.context)
     dd = spm.getPaymentMethod(name)
     
     if dd is None or IValidity(dd).isValid() == False:
         return False
     else:
         return True
Example #3
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,
     }
Example #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,
        }