Skip to content

vitaminsoftware/vitamin-pay

 
 

Repository files navigation

Vitamin Software Payment System

Handles ad-hoc credit card and Paypal payments for Vitamin Software LLC invoices. The repo is based on the Braintree integration for Flask example.

Setup Instructions

  1. Install requirements:
pip3 install -r requirements.txt
  1. Copy the contents of example.env into a new file named .env and fill in your Braintree API credentials. Credentials can be found by navigating to Account > My User > View Authorizations in the Braintree Control Panel. Full instructions can be found on our support site.

  2. Start server:

python3 app.py

By default, this runs the app on port 4567. You can configure the port by setting the environmental variable PORT.

Usage

The app will process card payments for invoices issued by Vitamin Software LLC invoices ONLY. The payment form is unique to each invoice and follows the pattern http://pay.vitaminsoftware.com/checkouts/[invoice]/[amount].

  • invoice field should match the invoice number we'd like to get paid for;
  • amount represents the total value of the invoice in cents (USD pence).

For example to receive a payment for invoice VIT00117 in the amount of $218.75 the following URL should be distributed to the client: http://pay.vitaminsoftware.com/checkouts/VIT00117/21875.

Deploying to Heroku

You can deploy this app directly to Heroku to see the app live. Skip the setup instructions above and click the button below. This will walk you through getting this app up and running on Heroku in minutes.

Deploy

Running tests

Unit tests do not make API calls to Braintree and do not require Braintree credentials. You can run this project's unit tests by calling python test_app.py on the command line.

Testing Transactions

Sandbox transactions must be made with sample credit card numbers, and the response of a Transaction.sale() call is dependent on the amount of the transaction.

Pro Tips

Help

Releases

No releases published

Packages

No packages published

Languages

  • CSS 69.7%
  • Python 17.7%
  • HTML 11.4%
  • Other 1.2%