Created
March 23, 2016 20:53
-
-
Save homanp/7b30ae583de9f64ce053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BillingCard(generics.UpdateAPIView): | |
permission_classes = (IsAuthenticated,) | |
def post(self, request): | |
cc_token = request.DATA.get('cc_token', None) | |
if cc_token: | |
company = helpers.create_customer(self, cc_token) | |
serializer = CompanySerializer(company) | |
return Response(serializer.data, status=status.HTTP_200_OK) | |
else: | |
return Response('No cc_token in request', | |
status=status.HTTP_400_BAD_REQUEST) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment