|
|
@@ -84,20 +84,20 @@ For example::
|
|
84
|
84
|
# Subclass the core Oscar view so we can customise
|
|
85
|
85
|
class PaymentDetailsView(views.PaymentDetailsView):
|
|
86
|
86
|
|
|
87
|
|
- def handle_payment(self, order_number, total_incl_tax, **kwargs):
|
|
|
87
|
+ def handle_payment(self, order_number, total, **kwargs):
|
|
88
|
88
|
# Talk to payment gateway. If unsuccessful/error, raise a
|
|
89
|
89
|
# PaymentError exception which we allow to percolate up to be caught
|
|
90
|
90
|
# and handled by the core PaymentDetailsView.
|
|
91
|
|
- reference = gateway.pre_auth(order_number, total_incl_tax, kwargs['bankcard'])
|
|
|
91
|
+ reference = gateway.pre_auth(order_number, total.incl_tax, kwargs['bankcard'])
|
|
92
|
92
|
|
|
93
|
93
|
# Payment successful! Record payment source
|
|
94
|
94
|
source_type, __ = models.SourceType.objects.get_or_create(
|
|
95
|
95
|
name="SomeGateway")
|
|
96
|
96
|
source = models.Source(
|
|
97
|
97
|
source_type=source_type,
|
|
98
|
|
- amount_allocated=total_incl_tax,
|
|
|
98
|
+ amount_allocated=total.incl_tax,
|
|
99
|
99
|
reference=reference)
|
|
100
|
100
|
self.add_payment_source(source)
|
|
101
|
101
|
|
|
102
|
102
|
# Record payment event
|
|
103
|
|
- self.add_payment_event('pre-auth', total_incl_tax)
|
|
|
103
|
+ self.add_payment_event('pre-auth', total.incl_tax)
|