Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Sandbox and production URLs in views.py #4

Open
ashish-naik opened this issue May 18, 2019 · 0 comments
Open

Handling Sandbox and production URLs in views.py #4

ashish-naik opened this issue May 18, 2019 · 0 comments

Comments

@ashish-naik
Copy link

Hi

Thanks for writing this code. I would like to handle sandbox and production URL in same code. I don't know Python so wanted to check whether below code looks fine in views.py. Everything remains same.

I have added URL variables to handle this.

response = requests.post(settings.RECEIPT_VERIFICATION_URL_PRODUCTION, data=json.dumps(data))
payload = response.json()
status = payload["status"]
if status == 21007
response = requests.post(settings.RECEIPT_VERIFICATION_URL_SANDBOX, data=json.dumps(data))
payload = response.json()
response = JSONResponse(payload)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant