Example #1
0
 def get_credit_cards(self):
     if not self.paymill_client_id:
         return []
     api = PayMillApi(settings.PAYMILL_PRIVATE_TEST_KEY)
     data = api.client_details(self.paymill_client_id)
     print data
     return data['payment']
Example #2
0
 def create_card_account(self):
     api = PayMillApi(settings.PAYMILL_PRIVATE_TEST_KEY)
     data = api.create_client(email=self.email, description=str(self))
     self.paymill_client_id = data['id']
     self.save()
Example #3
0
 def remove_credit_card(self, card_id):
     api = PayMillApi(settings.PAYMILL_PRIVATE_TEST_KEY)
     api.remove_card(card_id)
Example #4
0
 def add_credit_card(self, token):
     api = PayMillApi(settings.PAYMILL_PRIVATE_TEST_KEY)
     if not self.paymill_client_id:
         self.create_card_account()
     return api.create_card(token, self.paymill_client_id)