当前位置: 首页>>代码示例>>Python>>正文


Python CyberSource2.process_postpay_callback函数代码示例

本文整理汇总了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;未经允许,请勿转载。