Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/particulatesolutions/django-vr-payment
Django integration of VR Payment
https://github.com/particulatesolutions/django-vr-payment
Last synced: 3 months ago
JSON representation
Django integration of VR Payment
- Host: GitHub
- URL: https://github.com/particulatesolutions/django-vr-payment
- Owner: ParticulateSolutions
- License: mit
- Created: 2020-07-10T22:51:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-18T12:41:06.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T00:54:56.538Z (3 months ago)
- Language: Python
- Size: 42 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE
Awesome Lists containing this project
README
Django VR Payment Copy + Pay
============================Implementation of [VR Payment Copy + Pay](https://vr-pay-ecommerce.docs.oppwa.com/tutorials/integration-guide).
The following doc explain how to set up the VR Payment Copy + Pay base tutorial.Quick start
-----------1. Add "django_vr_payment" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'django_vr_payment',
]2. (optional) Include the vr-payment URLconf in your project urls.py like this::
path('vr-payment/', include('django_vr_payment.urls')),
3. Run ``python manage.py migrate`` to create the vr-payment models.
4. Prepare a checkout:
```python
from django_vr_payment.wrapper import VRPaymentWrappervr_payment_wrapper = VRPaymentWrapper()
basic_payment = vr_payment_wrapper.create_checkout(amount=, payment_type=, merchant_transaction_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
```5. Pay via a payment form of your choice. A working example can be seen in `VRPaymentBasicCheckoutView`
6. 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:
```python
from django_vr_payment.models import VRPaymentBasicPayment
from django_vr_payment.wrapper import VRPaymentWrappervr_payment_wrapper = VRPaymentWrapper()
basic_payment = VRPaymentBasicPayment.objects.get(checkout_id=)# 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.