eldarion/braintree_python

Name: braintree_python

Owner: Eldarion, Inc.

Description: braintree python client library

Created: 2011-03-15 18:16:15.0

Updated: 2016-07-17 18:10:55.0

Pushed: 2011-08-31 12:36:10.0

Homepage: http://www.braintreepaymentsolutions.com/gateway/python

Size: 375

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Braintree Python Client Library

The Braintree library provides integration access to the Braintree Gateway.

Dependencies

Note: Although discouraged, the dependency on PycURL can be bypassed during development or for deployment on servers where it is impossible to use via:

# Allow unsafe SSL, removes dependency on PycURL in dev environments
braintree.Configuration.use_unsafe_ssl = True
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",
    "credit_card": {
        "number": "4111111111111111",
        "expiration_date": "05/2012"
    }
})

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
License

See the LICENSE file.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.