Example #1
0
 def test_reversal(self, reversal, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     reversal.return_value = True
     ipn = IPN(urllib.urlencode(samples.sample_reversal))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_OK)
Example #2
0
 def test_reversal(self, reversal, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     reversal.return_value = True
     ipn = IPN(urllib.urlencode(samples.sample_reversal))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_OK)
Example #3
0
 def test_purchase_not(self, completed, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     completed.return_value = False
     ipn = IPN(urllib.urlencode(samples.sample_purchase))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)
Example #4
0
 def test_purchase(self, completed, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     completed.return_value = True
     ipn = IPN(urllib.urlencode(samples.sample_purchase))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_OK)
Example #5
0
 def test_chained_refund(self, refunded, post):
     post.return_value.text = 'VERIFIED'
     refunded.return_value = True
     ipn = IPN(urllib.urlencode(samples.sample_chained_refund))
     ipn.process()
     eq_(refunded.call_count, 1)
     eq_(ipn.status, constants.IPN_STATUS_OK)
Example #6
0
 def test_chained_refund(self, refunded, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     refunded.return_value = True
     ipn = IPN(urllib.urlencode(samples.sample_chained_refund))
     ipn.process()
     eq_(refunded.call_count, 1)
     eq_(ipn.status, constants.IPN_STATUS_OK)
Example #7
0
    def obj_create(self, bundle, request, **kwargs):
        form = IPNForm(bundle.data)
        if not form.is_valid():
            raise self.form_errors(form)

        ipn = IPN(form.cleaned_data['data'])
        ipn.process()
        bundle.ipn = ipn
        return bundle
Example #8
0
    def obj_create(self, bundle, request, **kwargs):
        form = IPNForm(bundle.data)
        if not form.is_valid():
            raise self.form_errors(form)

        ipn = IPN(form.cleaned_data['data'])
        ipn.process()
        bundle.ipn = ipn
        return bundle
Example #9
0
 def test_still_ignored(self, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     ipn = IPN(urllib.urlencode(samples.sample_refund))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)
Example #10
0
 def test_invalid(self, post):
     ipn = IPN('')
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)
Example #11
0
 def test_still_ignored(self, post):
     post.return_value.text = 'VERIFIED'
     post.return_value.status_code = 200
     ipn = IPN(urllib.urlencode(samples.sample_refund))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)
Example #12
0
 def test_invalid(self, post):
     ipn = IPN('')
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)
Example #13
0
 def test_purchase_not(self, completed, post):
     post.return_value.text = 'VERIFIED'
     completed.return_value = False
     ipn = IPN(urllib.urlencode(samples.sample_purchase))
     ipn.process()
     eq_(ipn.status, constants.IPN_STATUS_IGNORED)