spookylukey / django-paypal

A pluggable Django application for integrating PayPal Payments Standard or Payments Pro
MIT License
729 stars 208 forks source link

Simplified payment button customisation. #196 #258

Closed fabiocaccamo closed 2 years ago

fabiocaccamo commented 2 years ago

With this PR it is possible to customise the payment button by doing just this:

from paypal.standard.forms import PayPalPaymentsForm

class CustomPayPalPaymentsForm(PayPalPaymentsForm):

    def get_html_submit_element(self):
        return """<button type="submit">Continue on PayPal website</button>"""
spookylukey commented 2 years ago

This looks like a nice improvement, thanks!

Would you be able to write some docs? I think a new section on overriding the form at the bottom of this page would be good: https://django-paypal.readthedocs.io/en/latest/standard/ipn.html

fabiocaccamo commented 2 years ago

@spookylukey I updated the docs adding the button customisation block and fixing a broken link.

spookylukey commented 2 years ago

Thanks!