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

Python CyberSource2.process_postpay_callback函数代码示例

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

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



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

示例1: test_process_payment_raises_exception

 def test_process_payment_raises_exception(self, purchased_callback):  # pylint: disable=unused-argument
     self.order.clear()
     OrderItem.objects.create(
         order=self.order,
         user=self.user,
         unit_cost=self.COST,
         line_cost=self.COST,
     )
     params = self._signed_callback_params(self.order.id, self.COST, self.COST)
     process_postpay_callback(params)
开发者ID:alexmerser,项目名称:lms,代码行数:10,代码来源:test_CyberSource2.py


示例2: test_process_payment_declined

    def test_process_payment_declined(self):
        # Simulate a callback from CyberSource indicating that the payment was declined
        params = self._signed_callback_params(self.order.id, self.COST, self.COST, decision='DECLINE')
        result = process_postpay_callback(params)

        # Expect that we get an error message
        self.assertFalse(result['success'])
        self.assertIn(u"payment was declined", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:8,代码来源:test_CyberSource2.py


示例3: test_process_amount_paid_not_decimal

    def test_process_amount_paid_not_decimal(self):
        # Change the payment amount to a non-decimal
        params = self._signed_callback_params(self.order.id, self.COST, "abcd")
        result = process_postpay_callback(params)

        # Expect an error
        self.assertFalse(result['success'])
        self.assertIn(u"badly-typed value", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:8,代码来源:test_CyberSource2.py


示例4: test_process_payment_invalid_order

    def test_process_payment_invalid_order(self):
        # Use an invalid order ID
        params = self._signed_callback_params("98272", self.COST, self.COST)
        result = process_postpay_callback(params)

        # Expect an error
        self.assertFalse(result['success'])
        self.assertIn(u"inconsistent data", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:8,代码来源:test_CyberSource2.py


示例5: test_process_payment_invalid_signature

    def test_process_payment_invalid_signature(self):
        # Simulate a callback from CyberSource indicating that the payment was rejected
        params = self._signed_callback_params(self.order.id, self.COST, self.COST, signature="invalid!")
        result = process_postpay_callback(params)

        # Expect that we get an error message
        self.assertFalse(result['success'])
        self.assertIn(u"corrupted message regarding your charge", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:8,代码来源:test_CyberSource2.py


示例6: test_process_invalid_payment_amount

    def test_process_invalid_payment_amount(self):
        # Change the payment amount (no longer matches the database order record)
        params = self._signed_callback_params(self.order.id, "145.00", "145.00")
        result = process_postpay_callback(params)

        # Expect an error
        self.assertFalse(result['success'])
        self.assertIn(u"different amount than the order total", result['error_html'])
开发者ID:Appius,项目名称:edx-platform,代码行数:8,代码来源:test_CyberSource2.py


示例7: test_process_payment_rejected

    def test_process_payment_rejected(self):
        # Simulate a callback from CyberSource indicating that the payment was rejected
        params = self._signed_callback_params(self.order.id, self.COST, self.COST, accepted=False)
        result = process_postpay_callback(params)

        # Expect that we get an error message
        self.assertFalse(result['success'])
        self.assertIn(u"did not accept your payment", result['error_html'])
开发者ID:Appius,项目名称:edx-platform,代码行数:8,代码来源:test_CyberSource2.py


示例8: test_process_user_cancelled

    def test_process_user_cancelled(self):
        # Change the payment amount to a non-decimal
        params = self._signed_callback_params(self.order.id, self.COST, "abcd")
        params['decision'] = u'CANCEL'
        result = process_postpay_callback(params)

        # Expect an error
        self.assertFalse(result['success'])
        self.assertIn(u"you have cancelled this transaction", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:9,代码来源:test_CyberSource2.py


示例9: test_sign_then_verify_unicode

    def test_sign_then_verify_unicode(self, purchased_callback):
        params = self._signed_callback_params(
            self.order.id, self.COST, self.COST,
            first_name=u'\u2699'
        )

        # Verify that this executes without a unicode error
        result = process_postpay_callback(params)
        self.assertTrue(result['success'])
开发者ID:mercea,项目名称:edx-platform,代码行数:9,代码来源:test_CyberSource2.py


示例10: test_sign_then_verify_unicode

    def test_sign_then_verify_unicode(self, pdf_receipt_display_name, purchased_callback):  # pylint: disable=unused-argument
        params = self._signed_callback_params(
            self.order.id, self.COST, self.COST,
            first_name=u'\u2699'
        )

        # Verify that this executes without a unicode error
        result = process_postpay_callback(params)
        self.assertTrue(result['success'])
        self.assert_dump_recorded(result['order'])
开发者ID:alexmerser,项目名称:lms,代码行数:10,代码来源:test_CyberSource2.py


示例11: test_process_missing_parameters

    def test_process_missing_parameters(self, missing_param):
        # Remove a required parameter
        params = self._signed_callback_params(self.order.id, self.COST, self.COST)
        del params[missing_param]

        # Recalculate the signature with no signed fields so we can get past
        # signature validation.
        params['signed_field_names'] = 'reason_code,message'
        params['signature'] = self._signature(params)

        result = process_postpay_callback(params)

        # Expect an error
        self.assertFalse(result['success'])
        self.assertIn(u"did not return a required parameter", result['error_html'])
开发者ID:alexmerser,项目名称:lms,代码行数:15,代码来源:test_CyberSource2.py


示例12: test_process_no_credit_card_digits

    def test_process_no_credit_card_digits(self, pdf_receipt_display_name, purchased_callback):  # pylint: disable=unused-argument
        # Use a credit card number with no digits provided
        params = self._signed_callback_params(
            self.order.id, self.COST, self.COST,
            card_number='nodigits'
        )
        result = process_postpay_callback(params)

        # Expect that we processed the payment successfully
        self.assertTrue(
            result['success'],
            msg="Payment was not successful: {error}".format(error=result.get('error_html'))
        )
        self.assertEqual(result['error_html'], '')
        self.assert_dump_recorded(result['order'])

        # Expect that the order has placeholders for the missing credit card digits
        self.assertEqual(result['order'].bill_to_ccnum, '####')
开发者ID:alexmerser,项目名称:lms,代码行数:18,代码来源:test_CyberSource2.py


示例13: test_process_payment_success

    def test_process_payment_success(self, pdf_receipt_display_name, purchased_callback):  # pylint: disable=unused-argument
        # Simulate a callback from CyberSource indicating that payment was successful
        params = self._signed_callback_params(self.order.id, self.COST, self.COST)
        result = process_postpay_callback(params)

        # Expect that we processed the payment successfully
        self.assertTrue(
            result['success'],
            msg="Payment was not successful: {error}".format(error=result.get('error_html'))
        )
        self.assertEqual(result['error_html'], '')

        # Expect that the item's purchased callback was invoked
        purchased_callback.assert_called_with()

        # Expect that the order has been marked as purchased
        self.assertEqual(result['order'].status, 'purchased')
        self.assert_dump_recorded(result['order'])
开发者ID:alexmerser,项目名称:lms,代码行数:18,代码来源:test_CyberSource2.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python helpers.get_processor_config函数代码示例发布时间:2022-05-27
下一篇:
Python models.RegistrationCodeRedemption类代码示例发布时间: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