2

I have (a possibly easy) question about running braintree on a python heroku server as detailed here https://developers.braintreepayments.com/start/hello-server/python

Now, I am new to heroku and have tried and done a lot of tutorials, which all seem to create an application that is accessible by web server (as for example with python's flask).

Clearly, I cannot test my braintree app through web server. Is there any other way to correspond with my braintree serves once it's live to see if it is doing the right thing? From the console for example?

I am just wondering if there is a way other than through iOS to interact with my braintree server and test in- and output behaviour.

Also, currently I use a procfile of

web: gunicorn main_app:app

and

flask==0.10.1
dj-database-url==0.4.1
Django==1.9.7
gunicorn==19.6.0
psycopg2==2.6.1
whitenoise==2.0.6
braintree==3.32.0

in my requirements.txt, in both cases unsure if this is right.

AJGronevelt
  • 551
  • 1
  • 6
  • 22
  • Which version python do you use. Heroku is strict on Python version, either `2.7.12` or `3.5.2` is acceptable. And braintree SDK supports Python 2.6, 2.7, 3.3, and 3.4. – ling7334 Dec 13 '16 at 01:12
  • @ling7334 sorry I explained badly (I edited my question now), my python is running fine. I am wondering if there is any way other than through my iOS app to correspond with my Braintree python installation once it's installed on heroic, for testing purposes etc. Thank you! – AJGronevelt Dec 13 '16 at 12:27
  • Just want to clarify assumptions based on the info you've provided. You have created a Braintree integration using Flask as your server. You're hosting the integration on Heroku. You want to confirm that the server is functioning properly without using your iOS app. Have I missed anything? – Shea Dec 13 '16 at 20:31
  • @Shea thanks for reply -- it's almost as you say, except that my problem is that I am not (!) using flask. When I used flask, I could see my apps output in a browser and make sure it was ok. Now, I did everything as described in the braintree SDK (link included above) and then start it up and then ... that's it. The console tells me that one dyno is running but I wish I could test the braintree functions (before trying through iOS). – AJGronevelt Dec 13 '16 at 22:27

1 Answers1

1

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

curl is "a command line tool used for transferring data with URLs." Check out the manual for details and use cases.

For example, let's assume you you have a route defined to return a Braintree client token. You can use curl to make a request to that route.

curl https://your-apps-name.herokuapp.com/client_token

The HTML of the rendered page should include the token if your request was successful.

Shea
  • 886
  • 6
  • 12