Merge branch 'master' into feature/add_google_analytics

# Conflicts:
#	datacenterlight/templates/datacenterlight/order_detail.html
This commit is contained in:
Andrii Marynets 2017-07-02 17:56:07 +03:00
commit 303d99d70d
10 changed files with 328 additions and 188 deletions

View file

@ -77,6 +77,16 @@ class StripeUtils(object):
}
return new_card_data
@handleStripeError
def get_card_details(self, customer_id, token):
customer = stripe.Customer.retrieve(customer_id)
credit_card_raw_data = customer.sources.data.pop()
card_details = {
'last4': credit_card_raw_data.last4,
'brand': credit_card_raw_data.brand
}
return card_details
def check_customer(self, id, user, token):
customers = self.stripe.Customer.all()
if not customers.get('data'):