• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python credit.HpsCreditCard类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中securesubmit.entities.credit.HpsCreditCard的典型用法代码示例。如果您正苦于以下问题:Python HpsCreditCard类的具体用法?Python HpsCreditCard怎么用?Python HpsCreditCard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了HpsCreditCard类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_016_authorization_master_card

    def test_016_authorization_master_card(self):
        # Test 016a Authorization
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860 Dallas Pkwy'
        card_holder.address.zip = '750241234'

        card = HpsCreditCard()
        card.number = '5473500000000014'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        response = self.service.authorize(17.07)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)

        # test 016b Capture/AddToBatch
        capture = self.service.capture(response.transaction_id).execute()
        self.assertIsNotNone(capture)
        self.assertEqual('00', capture.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:28,代码来源:test_moto.py


示例2: test_032_level_ii_no_response

    def test_032_level_ii_no_response(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '372700699251018'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 1234

        response = self.service.charge(111.13)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_cpc_req(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
        self.assertEqual('0', response.cpc_indicator)

        cpc_data = HpsCPCData('9876543210', HpsTaxType.tax_exempt)
        cpc_response = self.service.cpc_edit(response.transaction_id)\
            .with_cpc_data(cpc_data)\
            .execute()

        self.assertIsNotNone(cpc_response)
        self.assertEqual('00', cpc_response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:29,代码来源:test_moto.py


示例3: test_020_partial_approval_master_card

    def test_020_partial_approval_master_card(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        direct_market_data = HpsDirectMarketData('123456')

        card = HpsCreditCard()
        card.number = '6011000990156527'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.charge(155)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)\
            .with_allow_partial_auth(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('10', response.response_code)
        self.assertIsNotNone(response.authorized_amount)
        self.assertEqual(u'100.00', response.authorized_amount)
        self.__class__.test_20_transaction_id = response.transaction_id
开发者ID:hps,项目名称:heartland-python,代码行数:26,代码来源:test_moto.py


示例4: test_010_charge_visa

    def test_010_charge_visa(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860 Dallas Pkwy'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        builder = self.service.charge(17.01)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)

        if self.use_tokens:
            builder.with_token(self.__class__.visa_token)
        else:
            builder.with_card(card)

        response = builder.execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
        self.__class__.test_10_transaction_id = response.transaction_id
开发者ID:hps,项目名称:heartland-python,代码行数:28,代码来源:test_moto.py


示例5: test_012_charge_discover

    def test_012_charge_discover(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '750241234'

        direct_market_data = HpsDirectMarketData('123456')

        card = HpsCreditCard()
        card.number = '6011000990156527'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        builder = self.service.charge(17.03)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)

        if self.use_tokens:
            builder.with_token(self.__class__.discover_token)
        else:
            builder.with_card(card)

        response = builder.execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:27,代码来源:test_moto.py


示例6: test_023_level_ii_response_r

    def test_023_level_ii_response_r(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.charge(123.45)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_cpc_req(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
        self.assertEqual('R', response.cpc_indicator)

        cpc_data = HpsCPCData('', HpsTaxType.tax_exempt)
        cpc_response = self.service.cpc_edit(response.transaction_id)\
            .with_cpc_data(cpc_data)\
            .execute()

        self.assertIsNotNone(cpc_response)
        self.assertEqual('00', cpc_response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:29,代码来源:test_moto.py


示例7: test_021_level_ii_response_b

    def test_021_level_ii_response_b(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860 Dallas Pkwy'
        card_holder.address.zip = '750241234'

        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.charge(112.34)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_cpc_req(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
        self.assertEqual('B', response.cpc_indicator)

        cpc_data = HpsCPCData('9876543210', HpsTaxType.not_used)
        cpc_response = self.service.cpc_edit(response.transaction_id)\
            .with_cpc_data(cpc_data)\
            .execute()

        self.assertIsNotNone(cpc_response)
        self.assertEqual('00', cpc_response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:29,代码来源:test_moto.py


示例8: test_027_level_ii_response_s

    def test_027_level_ii_response_s(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '5473500000000014'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.charge(111.08)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_cpc_req(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
        self.assertEqual('S', response.cpc_indicator)

        cpc_data = HpsCPCData('9876543210', HpsTaxType.sales_tax, 1.00)
        cpc_response = self.service.cpc_edit(response.transaction_id)\
            .with_cpc_data(cpc_data)\
            .execute()

        self.assertIsNotNone(cpc_response)
        self.assertEqual('00', cpc_response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:29,代码来源:test_moto.py


示例9: test_011_charge_master_card

    def test_011_charge_master_card(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '5473500000000014'
        card.exp_month = 12
        card.exp_year = 2015
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        builder = self.service.charge(17.02)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)

        if self.use_tokens:
            builder.with_token(self.__class__.mastercard_token)
        else:
            builder.with_card(card)

        response = builder.execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:derikrichards,项目名称:heartland-python,代码行数:27,代码来源:test_moto.py


示例10: test_018_partial_approval_visa

    def test_018_partial_approval_visa(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        response = self.service.charge(130)\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)\
            .with_allow_partial_auth(True)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('10', response.response_code)
        self.assertIsNotNone(response.authorized_amount)
        self.assertEqual(u'110.00', response.authorized_amount)
开发者ID:hps,项目名称:heartland-python,代码行数:25,代码来源:test_moto.py


示例11: test_013_charge_amex

    def test_013_charge_amex(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.address = '6860 Dallas Pkwy'
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '372700699251018'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 1234

        direct_market_data = HpsDirectMarketData('123456')

        builder = self.service.charge(17.04)\
            .with_card_holder(card_holder)\
            .with_direct_market_data(direct_market_data)

        if self.use_tokens:
            builder.with_token(self.__class__.amex_token)
        else:
            builder.with_card(card)

        response = builder.execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:27,代码来源:test_moto.py


示例12: test_037_fraud_prevention_sale

    def test_037_fraud_prevention_sale(self):
        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.charge(15000).with_card(card).execute()
        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:10,代码来源:test_moto.py


示例13: test_038_fraud_prevention_return

    def test_038_fraud_prevention_return(self):
        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        response = self.service.refund(15000).with_card(card).execute()
        self.assertIsNotNone(response)
        if response.response_code != '00':
            self.assertEqual('41', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:11,代码来源:test_moto.py


示例14: test_005_balance_inquiry_visa

    def test_005_balance_inquiry_visa(self):
        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025

        response = self.service.prepaid_balance_inquiry()\
            .with_card(card)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:12,代码来源:test_moto.py


示例15: test_cvv_with_leading_zero

    def test_cvv_with_leading_zero(self):
        self.charge_service._config = TestServicesConfig.valid_services_config

        card = HpsCreditCard()
        card.number = "4111111111111111"
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = "012"

        response = self.charge_service.authorize(15.15, 'usd', card)
        self.assertIsNotNone(response)
        self.assertEquals('00', response.response_code)
开发者ID:derikrichards,项目名称:heartland-python,代码行数:12,代码来源:test_general.py


示例16: test_001_verify_visa

    def test_001_verify_visa(self):
        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2015

        response = self.service.verify()\
            .with_card(card)\
            .with_request_multi_use_token(self.use_tokens)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('85', response.response_code)
开发者ID:derikrichards,项目名称:heartland-python,代码行数:13,代码来源:test_moto.py


示例17: test_002_verify_master_card

    def test_002_verify_master_card(self):
        card = HpsCreditCard()
        card.number = '5473500000000014'
        card.exp_month = 12
        card.exp_year = 2025

        response = self.service.verify()\
            .with_card(card)\
            .with_request_multi_use_token(self.use_tokens)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('85', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:13,代码来源:test_moto.py


示例18: test_034_offline_credit_return

    def test_034_offline_credit_return(self):
        card = HpsCreditCard()
        card.number = '5473500000000014'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        response = self.service.refund(15.15)\
            .with_card(card)\
            .with_direct_market_data(direct_market_data)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:16,代码来源:test_moto.py


示例19: test_033_offline_sale

    def test_033_offline_sale(self):
        card = HpsCreditCard()
        card.number = '4012002000060016'
        card.exp_month = 12
        card.exp_year = 2025
        card.cvv = 123

        direct_market_data = HpsDirectMarketData('123456')

        response = self.service.offline_charge(17.10)\
            .with_card(card)\
            .with_offline_auth_code('654321')\
            .with_direct_market_data(direct_market_data)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:17,代码来源:test_moto.py


示例20: test_004_verify_amex

    def test_004_verify_amex(self):
        card_holder = HpsCardHolder()
        card_holder.address = HpsAddress()
        card_holder.address.zip = '75024'

        card = HpsCreditCard()
        card.number = '372700699251018'
        card.exp_month = 12
        card.exp_year = 2025

        response = self.service.verify()\
            .with_card(card)\
            .with_card_holder(card_holder)\
            .with_request_multi_use_token(self.use_tokens)\
            .execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
开发者ID:hps,项目名称:heartland-python,代码行数:18,代码来源:test_moto.py



注:本文中的securesubmit.entities.credit.HpsCreditCard类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python gift.HpsGiftCard类代码示例发布时间:2022-05-27
下一篇:
Python credit.HpsCardHolder类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap