def test_live_customer(self): # Create customers result = Customer.create() Customer.create(FULL_CUSTOMER) Customer.create(CUSTOMER_WITH_CARD) # Read customer information. This returns the payment profile IDs # address IDs for the user customer_id = result.customer_id Customer.details(customer_id) # Update customer information Customer.update(customer_id, { 'email': '*****@*****.**', 'description': 'Cool web developer guy' }) # Delete customer information Customer.delete(customer_id) self.assertRaises(AuthorizeResponseError, Customer.delete, customer_id) Customer.list()
def test_live_customer(self): # Create customers result = Customer.create() Customer.create(FULL_CUSTOMER) Customer.create(CUSTOMER_WITH_CARD) # Read customer information. This returns the payment profile IDs # address IDs for the user customer_id = result.customer_id Customer.details(customer_id) # Update customer information Customer.update(customer_id, { 'email': '*****@*****.**', 'description': 'Cool web developer guy' }) # Delete customer information Customer.delete(customer_id) self.assertRaises(AuthorizeResponseError, Customer.delete, customer_id) Customer.list()
def test_live_customer_from_transaction(self): INVALID_TRANS_ID = '123' self.assertRaises(AuthorizeResponseError, Customer.from_transaction, INVALID_TRANS_ID) # Create the transaction transaction = CUSTOMER_WITH_CARD.copy() transaction['amount'] = random.randrange(100, 100000) / 100.0 result = Transaction.auth(transaction) trans_id = result.transaction_response.trans_id # Create the customer from the above transaction result = Customer.from_transaction(trans_id) customer_id = result.customer_id result = Customer.details(customer_id) self.assertEquals(transaction['email'], result.profile.email)
def test_live_customer_from_transaction(self): INVALID_TRANS_ID = '123' self.assertRaises(AuthorizeResponseError, Customer.from_transaction, INVALID_TRANS_ID) # Create the transaction transaction = CUSTOMER_WITH_CARD.copy() transaction['amount'] = random.randrange(100, 100000) / 100.0 result = Transaction.auth(transaction) trans_id = result.transaction_response.trans_id # Create the customer from the above transaction result = Customer.from_transaction(trans_id) customer_id = result.customer_id result = Customer.details(customer_id) self.assertEquals(transaction['email'], result.profile.email)