from . import assert_required_fields_set_correctly

# Make sure OSCAR_REQUIRED_ADDRESS_FIELDS is set correctly for VAT
# assessment
assert_required_fields_set_correctly()

@@ -1,8 +1,168 @@
+from oscar.apps.checkout.views import PaymentDetailsView as CorePaymentDetailsView  # noqa%0Afrom django.contrib import messages%0A%0Afrom oscar_vat_moss import vat%0A%0A
 from . i
@@ -324,8 +324,610 @@
 ectly()%0A
+%0A%0Aclass PaymentDetailsView(CorePaymentDetailsView):%0A%0A    def build_submission(self, **kwargs):%0A        submission = super(PaymentDetailsView, self).build_submission(**kwargs)%0A        try:%0A            vat.apply_to(submission)%0A            # Recalculate order total to ensure we have a%0A            # tax-inclusive total%0A            submission%5B'order_total'%5D = self.get_order_totals(%0A                submission%5B'basket'%5D, submission%5B'shipping_charge'%5D)%0A        except vat.VATAssessmentException as e:%0A            message = str(e)%0A            messages.error(self.request, message)%0A        return submission%0A

Add VAT-enabled PaymentDetailsView