This is the python library for the Samurai API from Fee Fighters. It allows you easily store customer payment information, and create transactions, without having to ever worry about having their credit card number cross your server.
This a set of credentials for making a credit card payment. It includes:
- less sensitive data that you will have access to (name, address, credit card expiration date, etc)
- more sensitive data that you won't have access to (credit card number and cvv)
- the state of the payment method (is data valid, is payment method redacted, etc)
Each Payment Method is identified by a
This is an action taken based on a payment method, and/or a previous transaction. There are a 5 different types of transactions.
- purchase - a complete payment
- authorize - the first part of a two-step payment
- capture - the second part of a two-step payment
- void - the cancellation of any previous payment
- credit - a partial or complete refund on an existing completed payment
Each Transaction is identified by a
reference_id, and each set of transactions that relate to each other (the capture for an earlier authorize, the void of an earlier purchase, etc) is identified by a
This library currently isn't a proper Python package, so you will have to get the source. The main directory serves as a module, though you should rename it to something like
samurai_client_python, since dashes aren't valid for module names. The directory also works as a Django application, if you would like to use it for that.
samurai_client_python.core and the file transparent_redirect.html.example contain everything necessary to use the Samurai API. You will be in charge of saving references to Payment Methods and Transactions Read More
samurai_client_python.views make up a Django app which call on
samurai_client_python.core. Read More (Though read first about Core, above)
This is if you want to run samurai_client_python test suite. It's good to test the code, and also to test if anything is wrong or just changed with the samurai API. If you suddenly start having unexplainable problems, this might be a good place to start.
If you want any of the tests to pass, you will need to create a file called test_credentials.py. Look at test_credentials.py.example for what to put in. Do not put credentials from real merchants or processors into this file. You should get test credentials from FeeFighters.
If you don't have this properly configured as part of Django, the Django tests will not pass.
Testing only core.py:
This will run every test, and fail the Django ones:
./manage.py test samurai_client_python
This requires that you have samurai_client_python in your INSTALLED_APPS.