Created
October 19, 2016 19:02
-
-
Save jas02/b9128b236c94285c49bdf3ed726b9339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from oscar.apps.checkout import views | |
from oscar.apps.payment import models | |
# Subclass the core Oscar view so we can customise | |
class PaymentDetailsView(views.PaymentDetailsView): | |
#template_name = 'cash_on_delivery/payment_details.html' | |
#template_name_preview = 'cash_on_delivery/preview.html' | |
template_name = 'cash_on_delivery/preview.html' | |
def handle_payment(self, order_number, total, **kwargs): | |
source_type, __ = models.SourceType.objects.get_or_create( | |
name="CashOnDelivery") | |
source = models.Source( | |
source_type=source_type, | |
amount_allocated=total.incl_tax) | |
self.add_payment_source(source) | |
# Record payment event | |
self.add_payment_event('cash-on-delivery', total.incl_tax) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment