summaryrefslogtreecommitdiff
path: root/payments
diff options
context:
space:
mode:
Diffstat (limited to 'payments')
-rw-r--r--payments/cybersource/forms.py4
-rw-r--r--payments/stripe/widgets.py10
2 files changed, 7 insertions, 7 deletions
diff --git a/payments/cybersource/forms.py b/payments/cybersource/forms.py
index 3a83672..5fedde0 100644
--- a/payments/cybersource/forms.py
+++ b/payments/cybersource/forms.py
@@ -13,8 +13,8 @@ from ..forms import CreditCardPaymentFormWithName
class FingerprintWidget(forms.HiddenInput):
def render(self, name, value, attrs=None):
- attrs = dict(attrs or {}, type=self.input_type, name=name)
- final_attrs = self.build_attrs(self.attrs, attrs)
+ final_attrs = dict(attrs or {}, type=self.input_type, name=name)
+ final_attrs.update(self.attrs)
final_attrs['session_id'] = value
return render_to_string(
'payments/cybersource_fingerprint.html', final_attrs)
diff --git a/payments/stripe/widgets.py b/payments/stripe/widgets.py
index 172ab63..2dc514f 100644
--- a/payments/stripe/widgets.py
+++ b/payments/stripe/widgets.py
@@ -31,8 +31,8 @@ class StripeCheckoutWidget(Input):
def render(self, name, value, attrs=None):
if value is None:
value = ''
- attrs = dict(attrs or {}, src='https://checkout.stripe.com/checkout.js')
- final_attrs = self.build_attrs(self.attrs, attrs)
+ final_attrs = dict(attrs or {}, src='https://checkout.stripe.com/checkout.js')
+ final_attrs.update(self.attrs)
del final_attrs['id']
if value != '':
# Only add the 'value' attribute if a value is non-empty.
@@ -46,6 +46,6 @@ class StripeWidget(HiddenInput):
js = ['https://js.stripe.com/v2/',
'js/payments/stripe.js']
- def build_attrs(self, base_attrs, extra_attrs=None):
- extra_attrs = dict(extra_attrs or {}, id='id_stripe_token')
- return super(StripeWidget, self).build_attrs(base_attrs, extra_attrs)
+ def __init__(self, attrs=None):
+ attrs = dict(attrs or {}, id='id_stripe_token')
+ super(StripeWidget, self).__init__(self, attrs=None)