A simple lightweight api client for awesome stripe
Project description
simple-stripe-client
A simple lightweight api client for awesome stripe.
Example
import simple_stripe_client
import os
STRIPE_SECRET_KEY = os.environ.get('STRIPE_SECRET_KEY')
# create client
stripe_api = simple_stripe_client.Api(STRIPE_SECRET_KEY, debug_http=True)
CHARGE_DATA = {
'amount': 15921,
'currency': 'gbp',
'capture' : False,
'source': 'tok_amex',
'metadata': {
'first_name' : 'Sachin',
'last_name' : 'Tendulkar',
}
}
# Creating Charge
charge = stripe_api.charges.post(**CHARGE_DATA)
CHARGE_ID = 'ch_xxx'
# Fetching Charge
charge = stripe_api.charges.id(CHARGE_ID).get()
# Update Charge
charge = stripe_api.charges.id(CHARGE_ID).post(description='Test Update')
# Capture Charge
charge = stripe_api.charges.id(CHARGE_ID).capture.post(amount=12000)
Building Stripe's Curl URLs
URLs would match one-to-one to stripe's curl api urls. For more links please refer to stripe doc
stripe_api.charges # == /v1/charges
stripe_api.charges.id(CHARGE_ID) # == /v1/charges/{CHARGE_ID}
stripe_api.customers # == /v1/customers
stripe_api.customers.id(CUSTOMER_ID) # == /v1/customers/{CUSTOMER_ID}
stripe_api.invoices # == /v1/invoices
stripe_api.invoices.id(INVOICE_ID) # == /v1/invoices/{INVOICE_ID}
TODO
- Add support for Stripe Connect, Files
- Add more extensive tests
Changelog -
0.0.1 (01-02-2019)
- initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for simple_stripe_client-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45c8056b527f51772d6ebd81ba3abb1eddb2a686ae72f9ab84b69eb36987740 |
|
MD5 | 17b71686edd76692473bb2c71a5587d3 |
|
BLAKE2b-256 | 9ea444b303dc4429b9dbd04287992bdf904244a0b72b45324ea26336f09f92b3 |
Close
Hashes for simple_stripe_client-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd789bacd2e27a6fce96291a788660b546ac5a01c398bfe1dd02b179f25476fb |
|
MD5 | 30c2c860e62671ccf8de539581dbc892 |
|
BLAKE2b-256 | c718b3abde970d52bf4eabea42d15aa71dfd714fa97009490afeab2f4ba42bae |