Skip to main content

A pluggable Django application for integrating WebToPay Payments

Project description

Inspired by django-paypal

How to use

  1. install django-webtopay

  2. add WEBTOPAY_PASSWORD='pass' to your settings file

  3. Add callback url:: url(r’^wtp/’, include(‘webtopay.urls.makro’)) (it should be relatively hard to guess)

  4. Create a form for submission:

    form = WebToPaymentForm(
        dict(projectid = 123123,
            orderid = '3c3662bcb661d6de679c636744c66b62',
            accepturl = request.build_absolute_uri(),
            cancelurl = request.build_absolute_uri(),
            callbackurl = reverse('webtopay-makro'),
            paytext = "Payment for services",
            p_firstname = "Vardenis",
            p_lastname = "Pavardenis",
            p_email = "",
            amount = 989, # 9 Lt 89 ct
            test = 1
        button_html="<input type='submit' value='Pay!'/>",
  1. Catch a django signal when the payment is completed:

    from webtopay.signals import payment_was_successful
    def process_payment(**kargs):
        trans = kargs['sender']
        if price_i_expect * 100 != trans.amount:
            log.error("Received wrong amount. Expected: %d, got: %d",\
                price_i_expect*100, trans.amount)
        paid = True
        # from this point we assume customer paid

You should catch payment_was_flagged signal if you want to know when something went wrong:

from webtopay.signals import payment_was_flagged
def investigate_payment(**kargs):
    # kargs['sender'] is an instance of WebToPayResponse.
    # All fields are documented in webtopay/
    log.warn("Payment went wrong for %s, please investigate",

If you have any questions or problems, please use issues page.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-webtopay, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size django-webtopay-1.0.1.tar.gz (12.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page