Skip to content

Basic application that routes DragonPay request depending on param2 value

Notifications You must be signed in to change notification settings

ibaguio/django_dragonpay_router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django DragonPay Router

A basic django application that routes dragonpay requests to internal applications depending on the prefix of the transction id (txnid or merchanttxnid). This app is useful to if you want to utilize a DragonPay subscription across multiple applications.

Please see django_dragonpay to utilize DragonPay as a payment channel for django projects.

Installation and configuration

Deploy as a stand alone application using gunicorn.

Configure the routes by adding the environment variable DRAGONPAY_ROUTE_ROUTEKEY where ROUTEKEY is the string to be matched in DRAGONPAY_TXNID_PREFIX of the DragonPay request. See configuration of django_dragonpay to know more about transaction prefix

Consider two applications, APP_A and APP_B, running on the same machine with the following parameters:

Field App_A App_B
App Name / identifier myapp otherapp
DRAGONPAY_TXNID_PREFIX myapp otherapp
Endpoint URL http://localhost:8001/myapp/dp/ http://localhost:8002/otherapp/dp/

The following env vars would be the proper configuration of django_dragonpay_router

Environmental Variable Value
DRAGONPAY_ROUTE_MYAPP http://localhost:8001/myapp/dp/
DRAGONPAY_ROUTE_OTHERAPP http://localhost:8002/otherapp/dp/

Sample DragonPay transaction request

Notes

  • Make sure that all apps has a configured DRAGONPAY_TXNID_PREFIX, by default there is no txnid prefix, so this must be explicitly set.
  • Make sure that endpoint urls of applications are accessible from the django_dragonpay_router application.

About

Basic application that routes DragonPay request depending on param2 value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages