This commit is contained in:
Nico Schottelius 2020-02-20 09:44:30 +01:00
commit 074efffaa7
6 changed files with 56 additions and 6 deletions

View file

@ -4,9 +4,9 @@ import stripe
import stripe.error
import logging
from config import etcd_client as client, config as config
stripe.api_key = config['stripe']['private_key']
# FIXME: way too many dependencies in this import
# Most of them are not needed for stripe
#from config import etcd_client as client, config as config
def handle_stripe_error(f):
@ -73,8 +73,9 @@ class StripeUtils(object):
PLAN_EXISTS_ERROR_MSG = 'Plan {} exists already.\nCreating a local StripePlan now.'
PLAN_DOES_NOT_EXIST_ERROR_MSG = 'Plan {} does not exist.'
def __init__(self):
def __init__(self, private_key):
self.stripe = stripe
stripe.api_key = private_key
@handle_stripe_error
def card_exists(self, customer, cc_number, exp_month, exp_year, cvc):