def test_payment_profiles(self): today = date.today() visa = self.approved_cards['visa'] card = billing.CreditCard('John Doe', visa['number'], str(today.month), str(today.year + 3), visa['cvd']) txn = self.beanstream.create_payment_profile( card, billing_address=self.billing_address) resp = txn.commit() assert resp.approved() customer_code = resp.customer_code() txn = self.beanstream.purchase_with_payment_profile(50, customer_code) txn.set_comments( '%s:test_payment_profiles:purchase_with_payment_profile' % __name__) resp = txn.commit() assert resp.approved() txn = self.beanstream.modify_payment_profile(customer_code) txn.set_status('disabled') resp = txn.commit() assert resp.approved() txn = self.beanstream.purchase_with_payment_profile(50, customer_code) txn.set_comments( '%s:test_payment_profiles:purchase_with_payment_profile' % __name__) resp = txn.commit() assert not resp.approved()
def test_create_recurring_billing(self): today = date.today() visa = self.approved_cards['visa'] card = billing.CreditCard('John Doe', visa['number'], str(today.month), str(today.year + 3), visa['cvd']) txn = self.beanstream.create_recurring_billing_account( 50, card, 'w', 2, billing_address=self.billing_address) txn.set_comments( '%s:test_create_recurring_billing:create_recurring_billing' % __name__) resp = txn.commit() assert resp.approved() assert resp.cvd_status() == 'CVD Match' assert resp.account_id() is not None account_id = resp.account_id() txn = self.beanstream.modify_recurring_billing_account(account_id) txn.set_comments( '%s:test_create_recurring_billing:modify_recurring_billing' % __name__) txn.set_billing_state('closed') resp = txn.commit() assert resp.approved()
def test_failed_cvd(self): today = date.today() visa = self.approved_cards['visa'] card = billing.CreditCard('John Doe', visa['number'], str(today.month), str(today.year + 3), '000') txn = self.beanstream.purchase(50, card, self.billing_address) txn.set_comments('%s:test_failed_cvd' % __name__) resp = txn.commit() assert not resp.approved() assert resp.cvd_status() == 'CVD Mismatch'
def test_over_limit_cc_purchase(self): today = date.today() visa_limit = self.approved_cards['100_visa'] card = billing.CreditCard('John Doe', visa_limit['number'], str(today.month), str(today.year + 3), visa_limit['cvd']) txn = self.beanstream.purchase(250, card, self.billing_address) txn.set_comments('%s:test_over_limit_cc_purchase' % __name__) resp = txn.commit() assert not resp.approved() assert resp.cvd_status() == 'CVD Match'
def test_payment_profile_from_recurring_billing(self): today = date.today() visa = self.approved_cards['visa'] card = billing.CreditCard('John Doe', visa['number'], str(today.month), str(today.year + 3), visa['cvd']) txn = self.beanstream.create_payment_profile( card, billing_address=self.billing_address) resp = txn.commit() assert resp.approved() customer_code = resp.customer_code() txn = self.beanstream.create_recurring_billing_account_from_payment_profile( 25, customer_code, 'w', 4) txn.set_comments( '%s:test_payment_profile_from_recurring_billing:create_recurring_billing_account_from_payment_profile' % __name__) resp = txn.commit() assert resp.approved() assert resp.account_id() is not None