A Django app to handle payment request through vr payment.
Project description
Django VR Payment Copy + Pay
Implementation of VR Payment Copy + Pay. The following doc explain how to set up the VR Payment Copy + Pay base tutorial.
Quick start
-
Add "django_vr_payment" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'django_vr_payment', ]
-
(optional) Include the vr-payment URLconf in your project urls.py like this::
path('vr-payment/', include('django_vr_payment.urls')),
-
Run
python manage.py migrate
to create the vr-payment models. -
Prepare a checkout:
from django_vr_payment.wrapper import VRPaymentWrapper vr_payment_wrapper = VRPaymentWrapper() basic_payment = vr_payment_wrapper.create_checkout(amount=<Decimal>, payment_type=<VRPaymentBasicPayment.PAYMENT_TYPE>, merchant_transaction_id=<UNIQUE_ID>) # the checkout_id for the VR Payment Copy&Pay form can be obtained through `checkout_id` checkout_id_for_forms = basic_payment.checkout_id
-
Pay via a payment form of your choice. A working example can be seen in
VRPaymentBasicCheckoutView
-
Get the payment status:
On return to
VR_PAYMENT_SHOPPER_RESULT_URL_NAME
, the app tries to get the status of a checkout object. You can also query VR Payment yourself:from django_vr_payment.models import VRPaymentBasicPayment from django_vr_payment.wrapper import VRPaymentWrapper vr_payment_wrapper = VRPaymentWrapper() basic_payment = VRPaymentBasicPayment.objects.get(checkout_id=<CheckoutID>) # get 'initial' status querying the checkout api payment_status = vr_payment_wrapper.get_checkout_status(basic_payment) # or query transaction api either by vr_payment_checkout.payment_id or vr_payment_checkout.merchant_transaction_id payment_status = vr_payment_wrapper.get_transaction_by_merchant_transaction_id(basic_payment)
Copyright and license
Copyright 2020 Particulate Solutions GmbH, under MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-vr-payment-0.2.8.tar.gz
.
File metadata
- Download URL: django-vr-payment-0.2.8.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b333f2d807225c33395cac54bca48fd487d1b41d3ba1724f17027867ae2c40fb |
|
MD5 | 2a6ff3a1f55c4950adb0cbd746b7e4d3 |
|
BLAKE2b-256 | dee15df6c6b31686dc486ea324f626d29bcbea63020e00d5cf53f56855c63d8d |