Maintainer Wanted

I no longer have any side projects that use django-pinpayments and I don’t have the time or headspace to maintain an important project. If you’re interested in helping maintain this project, add new features, etc then please get in touch via the relevant issue.


django-pinpayments provides helper functions for Pin Payments – a relatively new Australian payment processor that doesn’t require merchant accounts and that doesn’t require purchasers to have an account. Some may call it the “Australian version of Stripe”.

django-pinpayments provides template tags to render the Pin.js payment form, which uses the Card API for processing. This means you can collect credit card details on your website, submit them via javascript to Pin (without them landing on your server), then process the payment on your server using the single-use card token that Pin return.

The provided Card tokens can also be used to create Customer tokens, to use for delayed or recurring billing.

django-pinpayments is designed to be a simple base for your own billing projects. It doesn’t make too many assumptions, and leaves many things open for your design input.

Not Included

  • Any link to your existing models or business logic
  • Views for users to review/update their stored credit cards, or review previous transactions


  • Tests
  • More documentation
  • Signals on success or failure



  • PIN_ENVIRONMENTS – a dictionary of dictionaries containing Pin API keys & secrets
  • PIN_DEFAULT_ENVIRONMENT – a pointer to the environment to be used at runtime, if no specific environment is requested.

Warning: Make sure your settings do not end up in public source repositories, as they can be used to process payments in your name.


Each environment must have the ‘key’ and ‘secret’ values.

I highly recommend at least test & production, however you can also configure other key pairs if you have eg a separate Pin account for part of your website. Perhaps you have membership sales processed by one account, and merchandise by another.

This setting, with at least one environment, is required for django-pinpayments to function. There is no default.

        'test': {
            'key': 'pk_qokBvPpEHIVmNETSoSdDVYP',
            'secret': 'MBjZMurpDtjDANDNFQObZmBhMg',
            'host': '',
        'live': {
            'key': 'pk_yGCGLonMHJMFscFyNaLZdkEV',
            'secret': 'tOAQeMsMaBrxejJHIqHJVIObUS',
            'host': '',
        'live_project2': {
            'key': 'pk_ByNNmfJfsMywEIEa-aCteTR',
            'secret': 'CPslpGmoakWdPuxjtrfibZVLaS',
            'host': '',

API keys and secrets are available from your Pin Account page. Hosts should not include https or a trailing slash; these will be added automatically.


At runtime, the {% pin_headers %} template tag can define which environment to use. If you don’t specify an environment in the template tag, this setting determines which account to use.


Template Tags

Two template tags are included. One includes the Pin.js library and associated JavaScript, and the other renders a form that doesn’t submit to your server. Both are required.

Both tags are in pin_payment_tags, so you should include {% load pin_payment_tags %} somewhere near the top of your template.

pin_headers – Render pin.js and helper functions

This tag should be called inside the head tag of your HTML page. It will render multiple <script> tags: one to load pin.js, the other to define a function that will run on submit of the form to load the card token from the Pin API.

<div class="highlight highlight-text-html-basic position-relative" data-snippet-clipboard-copy-content=" {% load pin_payment_tags %}

My Payment Page

{% pin_header "test" %}


    {% load pin_payment_tags %}
            <title>My Payment Page</title>
            <script src='/path/to/jquery.js'></script>
            {% pin_header "test" %}
            <!-- page content -->