Django app for [Talar.app](https://talar.app) service.
Project description
django-talar
Django app for Talar.app service.
Installation
-
pip install django-talar
. -
Add
talar
to your django settingsINSTALLED_APPS
. -
Modify code below and also insert it into django settings:
TALAR = { 'project_id': env.str('TALAR_PROJECT_ID', None), 'access_key_id': env.str('TALAR_ACCESS_KEY_ID', None) 'access_key': env.str('TALAR_ACCESS_KEY', None), }
-
Include this into your core urls:
path('talar/', include(('talar.urls', 'talar'))),
Basic usage
django-talar contains basic form talar.forms.PaymentForm
and template
talar/talar_make_payment.html
for making payments. It is suggested to
use it by adding your own view like so:
def make_payment(request):
data = {
'external_id': EXTERNAL_ID, # You order/payment unique key that will be used to identify payment
'amount': AMOUNT, # your data
'currency': CURRENCY, # your data
'continue_url': CONTINUE_URL, # Insert address for redirection after successfull payment
}
talar = Talar()
url = talar.url
data = talar.create_payment_data(data)
payment_form = PaymentForm(data={
'key_id': talar.access_key_id,
'encrypted': data
})
return render(request, 'talar/make_payment.html', {
'url': url,
'payment_form': payment_form
})
html code will handle redirection if everything is correct:
<div>
<p>{% trans 'After continuing you will be redirected to payment provider site.' %}</p>
<form action="{{ url }}" method="post" class="form-inline">
{{ payment_form.as_p }}
<button type=submit class="btn btn-primary">{% trans 'Pay' %}</button>
</form>
</div>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-talar-0.1.4.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for django_talar-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f052123158a0c600d5f4b7e9685bd505e1318d7c8fa3857696370f230fa6f0a |
|
MD5 | beecb5e10fe00e9bd73d1f234d3c4991 |
|
BLAKE2b-256 | 7ad37cc5b34f2d26ea0e7c6c60b90678f31e1628c28ed13ffcb4c419e8d5d4d5 |