Skip to main content

A Django app to handle payment request through vr payment (copy + pay).

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

  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:

    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
    
  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:

    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

django-vr-pay-0.1.2.tar.gz (17.5 kB view details)

Uploaded Source

File details

Details for the file django-vr-pay-0.1.2.tar.gz.

File metadata

  • Download URL: django-vr-pay-0.1.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for django-vr-pay-0.1.2.tar.gz
Algorithm Hash digest
SHA256 23dd5ddf530af8d8146b0e7811332ce03ba1441d687115205327d2058825daca
MD5 9f9a916bff231c61ac6e66b3e0245430
BLAKE2b-256 4a8e832ce4676d45c72ed85a6dd208ca3bfa291950590006b41fed5d012a2931

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page