Skip to content

Python3pkg/Affirmpy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Affirmpy

A Python client lib for the Affirm API. Inspired by the project affirm-ruby.

Developed on Python 2.7. Should work on Python 3 as well.

Install

Add to your requirements.txt

Affirmpy

and pip install -r requirements.txt

Alternatively, install directly:

pip install Affirmpy

Initialize

Set an initial client with credentials:

from affirmpy.api import API

API.public_key = "WHEE"
API.secret_key = "WOOO"
API.api_url    = "https://www.idontknowwhatimdoing.com/"

Charges

All API requests raise an Error or subtype on failure.

Start with:

from affirmpy.charge import Charge

Creating Charges

charge = Charge.create('token')

Retrieving a Charge

charge = Charge.retrieve('macklemore')

Raises ResourceNotFoundError if nonexistent charge.

Capturing charges

About

A Python library for the Affirm API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%