Example #1
0
    def validate(self):
        try:
            self.address.clean_fields()
        except ValidationError as e:
            raise InvalidData(e.messages)

        if not self.email:
            raise InvalidData()
Example #2
0
    def validate(self, checkout_id):
        checkout = self.client.get_checkout(checkout_id)
        customer = session.get('customer', None)
        if customer is None:
            raise InvalidData('Session Error')

        if checkout['status'] == 'PAID':
            self.submit_sales_order()
            self.make_payment_entry()
            self.clear_cart()
        else:
            raise InvalidData('Payment not accepted')
Example #3
0
    def validate(self, checkout_id):
        checkout = self.client.get_checkout(checkout_id)
        customer = session.get("customer", None)
        if customer is None:
            raise InvalidData("Session Error")

        if checkout["status"] == "PAID":
            self.submit_sales_order()
            self.make_payment_entry()
            self.clear_cart()
        else:
            raise InvalidData("Payment not accepted")
Example #4
0
    def validate(self, checkout_id):
        intent = stripe.PaymentIntent.retrieve(checkout_id)

        customer = session.get('customer', None)
        if customer is None:
            raise InvalidData('Session Error')

        if intent['status'] == "succeeded":
            self.submit_sales_order()
            self.make_payment_entry(self.sales_order['name'], customer, float(intent['amount'])/100.0, intent['id'])
            self.clear_cart()
        else:
            raise InvalidData('Payment not accepted')
Example #5
0
    def validate(self, checkout_id):
        intent = stripe.PaymentIntent.retrieve(checkout_id)

        customer = session.get("customer", None)
        if customer is None:
            raise InvalidData("Session Error")

        if intent["status"] == "succeeded":
            self.submit_sales_order()
            self.make_payment_entry(
                self.sales_order["name"],
                customer,
                float(intent["amount"]) / 100.0,
                intent["id"],
            )
            self.clear_cart()
        else:
            raise InvalidData("Payment not accepted")
Example #6
0
 def validate(self):
     raise InvalidData()
Example #7
0
 def validate(self):
     if not 'email' in self.storage:
         raise InvalidData()
Example #8
0
 def validate(self):
     super(ShippingStep, self).validate()
     if 'delivery_method' not in self.storage:
         raise InvalidData()
Example #9
0
 def validate(self):
     super(BillingAddressStep, self).validate()
     if 'anonymous' in self.forms and not self.anonymous_user_email:
         raise InvalidData()
Example #10
0
 def validate(self):
     if not self.forms_are_valid():
         raise InvalidData()
Example #11
0
 def validate(self):
     if not 'email' in self.group:
         raise InvalidData()
Example #12
0
 def validate(self):
     selected_method_name = self.storage.get('shipping_method')
     valid_methods = [d['method'].name for d in self.available_shipping]
     if selected_method_name not in valid_methods:
         raise InvalidData(_('Select a valid shipping method'))