GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - directangular/braintree_python: braintree python client library

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

96 Commits
96 Commits

Folders and files

NameName
Last commit message
Last commit date
braintree
braintree
 
 
docs
docs
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
ci.sh
ci.sh
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

Braintree Python Client Library

The Braintree library provides integration access to the Braintree Gateway.

Dependencies

  • Python 2.6, 2.7, 3.3, 3.4, or 3.5
  • requests

Upgrading from 2.x.x to 3.x.x

On Python 2.6 or 2.7 with default settings / requests:

No changes are required to upgrade to version 3.

On Python 2.6 or 2.7 with pycurl, httplib, or use_unsafe_ssl = True:

Install requests and test that you are able to connect to the Sandbox environment with version 3 and without specifying an HTTP strategy. The use_unsafe_ssl parameter will be ignored.

On Python 2.5:

Python 2.5 isn't supported by version 3 of the library. Most code that runs on 2.5 will work unmodified on Python 2.6. After making sure your code works on Python 2.6, follow the instructions above for upgrading from pycurl / httplib to requests.

Documentation

  • Official documentation

Quick Start Example

import braintree

braintree.Configuration.configure(
    braintree.Environment.Sandbox,
    "your_merchant_id",
    "your_public_key",
    "your_private_key"
)

result = braintree.Transaction.sale({
    "amount": "1000.00",
    "payment_method_nonce": nonce_from_the_client,
    "options": {
        "submit_for_settlement": True
    }
})

if result.is_success:
    print("success!: " + result.transaction.id)
elif result.transaction:
    print("Error processing transaction:")
    print("  code: " + result.transaction.processor_response_code)
    print("  text: " + result.transaction.processor_response_text)
else:
    for error in result.errors.deep_errors:
        print("attribute: " + error.attribute)
        print("  code: " + error.code)
        print("  message: " + error.message)

Testing

Our friends at Venmo have an open source library designed to simplify testing of applications using this library.

The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake(rake test:unit) or nose(nosetests tests/unit).

Open Source Attribution

A list of open source projects that help power Braintree can be found here.

License

See the LICENSE file.

About

braintree python client library

developers.braintreepayments.com/python/sdk/server/overview

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.