Exemplo n.º 1
0
            def bind(self, userprofile):

                data = self.cleaned_data

                _create_balanced_customer(userprofile)
                account = userprofile.balanced_account

                if account:
                    if data['balancedtoken'].strip() != '' \
                    and (   "cod" in data.get('paymentsoffered')
                            or "terms" in data.get('paymentsoffered')
                    ):
                        account.add_card(data['balancedtoken'])
                    if data['banktoken'].strip() != '' and "cc" in data.get('paymentsoffered'):
                        account.add_bank_account(data['banktoken'])

                cc_acct = CreditCardAccount()
                cc_acct.firstname   = data['first']
                cc_acct.lastname    = data['last']
                cc_acct.address     = data['addressline1'] # + ' ' + data['addressline2'] # Not supported
                cc_acct.city        = data['city']
                cc_acct.state       = data['state']
                cc_acct.zip         = data['zip']

                cc_acct.save()
Exemplo n.º 2
0
            def bind(self, userprofile):
                data = self.cleaned_data

                _create_balanced_customer(userprofile)
                account = userprofile.balanced_account

                if data['balancedtoken'].strip() != '':
                    account.add_card(data['balancedtoken'])

                cc_acct = CreditCardAccount()
                cc_acct.firstname   = data['first']
                cc_acct.lastname    = data['last']
                cc_acct.address     = data['addressline1'] # + ' ' + data['addressline2'] # Not supported
                cc_acct.city        = data['city']
                cc_acct.state       = data['state']
                cc_acct.zip         = data['zip']

                cc_acct.save()