Exemplo n.º 1
0
    def test_confirm(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        TransactionType.objects.create(name='EasyPay', internal_name = 'payments.easypay')
        
        response = c.post(reverse('getpaid-easypay-pay'), """<Request>
<DateTime>yyyy-MM-ddTHH:mm:ss</DateTime>
<Sign></Sign>
<Payment>
<ServiceId>1</ServiceId>
<OrderId>1</OrderId>
<Account>010001</Account>
<Amount>10.11</Amount>
</Payment>
</Request>""", content_type='text/xml')
        print response.content
        bs = BeautifulSoup(response.content)
        response = c.post(reverse('getpaid-easypay-pay'), """<Request>
<DateTime>yyyy-MM-ddTHH:mm:ss</DateTime>
<Sign></Sign>
<Confirm>
<ServiceId>1</ServiceId>
<PaymentId>%s</PaymentId>
</Confirm>
</Request>""" % bs.response.paymentid, content_type='text/xml')
        
        print 'TRANSACTION=', Transaction.objects.get(type__internal_name='payments.easypay', bill='1')
        
        print response.content
Exemplo n.º 2
0
    def test_check(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        c.login(username= '******', password= '******')
        TransactionType.objects.create(name=u'Единая касса', internal_name = 'payments.w1ru')
        response = c.post(reverse('getpaid-new-payment'), {"summ": "10.00", "backend": "payments.w1ru"})
        from getpaid.models import Payment
        
        payment = Payment.objects.filter().order_by('-id')[0]

        print response.content
        
        d = {"WMI_MERCHANT_ID": PaymentProcessor.get_backend_setting('MERCHANT_ID',''), 
                           "WMI_PAYMENT_AMOUNT": '10.00',
                          "WMI_CURRENCY_ID": '643',
                          "WMI_TO_USER_ID": '123456789012',
                          "WMI_PAYMENT_NO": payment.id,
                          "WMI_ORDER_ID": '12345',
                          "WMI_DESCRIPTION": 'descr',
                          "WMI_SUCCESS_URL": 'http://ya.ru',
                          "WMI_FAIL_URL": 'http://ya.ru',
                          "WMI_EXPIRED_DATE": '2012-01-01T00:00:00',
                          "WMI_CREATE_DATE": '2012-01-01T00:00:00',
                          "WMI_UPDATE_DATE": '2012-01-01T00:00:00',
                          "WMI_ORDER_STATE": 'Accepted',
                          }
        d['WMI_SIGNATURE'] = PaymentProcessor.compute_sig(d)
        response = c.post(reverse('getpaid-w1ru-postback'), d)
        print response.content
Exemplo n.º 3
0
    def test_pay(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        TransactionType.objects.create(name=u'Сбербанк РФ', internal_name = 'payments.ru_sberbank')
        
        
        response = c.post(reverse('getpaid-rusberbank-pay'), u"""<?xml version="1.0" encoding="utf-8"?>
<request>
<params>
<act>2</act>
<agent_date>2009-04-15T11:22:33</agent_date>
<pay_id>2345</pay_id>
<pay_date>2009-04-15T11:00:12</pay_date>
<account>010001</account>
<pay_amount>10000</pay_amount>
<client_name>Иванов</client_name>
<month>03.2009</month>
</params>
<sign>853ee7471ac2eb774e850c727998e0cd</sign>
</request>""", content_type='text/xml')
        print response.content
        xml = BeautifulSoup(response.content)
        self.assertEqual(Transaction.objects.filter(type__internal_name='payments.ru_sberbank', bill='2345').count(), 1)
Exemplo n.º 4
0
    def test_pay(self):
        c = Client()
        acc = Account()
        acc.username = '******'
        acc.password = '******'
        acc.fullname = 'foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        TransactionType.objects.create(name=u'Сбербанк РФ',
                                       internal_name='payments.ru_sberbank')

        response = c.post(reverse('getpaid-rusberbank-pay'),
                          u"""<?xml version="1.0" encoding="utf-8"?>
<request>
<params>
<act>2</act>
<agent_date>2009-04-15T11:22:33</agent_date>
<pay_id>2345</pay_id>
<pay_date>2009-04-15T11:00:12</pay_date>
<account>010001</account>
<pay_amount>10000</pay_amount>
<client_name>Иванов</client_name>
<month>03.2009</month>
</params>
<sign>853ee7471ac2eb774e850c727998e0cd</sign>
</request>""",
                          content_type='text/xml')
        print response.content
        xml = BeautifulSoup(response.content)
        self.assertEqual(
            Transaction.objects.filter(
                type__internal_name='payments.ru_sberbank',
                bill='2345').count(), 1)
Exemplo n.º 5
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username='******'
     acc.password='******'
     acc.fullname='foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     response = c.post(reverse('getpaid-easypay-pay'), "")
     print response.content
Exemplo n.º 6
0
    def test_check(self):
        c = Client()
        acc = Account()
        acc.username = '******'
        acc.password = '******'
        acc.fullname = 'foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        c.login(username='******', password='******')
        TransactionType.objects.create(name=u'Единая касса',
                                       internal_name='payments.w1ru')
        response = c.post(reverse('getpaid-new-payment'), {
            "summ": "10.00",
            "backend": "payments.w1ru"
        })
        from getpaid.models import Payment

        payment = Payment.objects.filter().order_by('-id')[0]

        print response.content

        d = {
            "WMI_MERCHANT_ID":
            PaymentProcessor.get_backend_setting('MERCHANT_ID', ''),
            "WMI_PAYMENT_AMOUNT":
            '10.00',
            "WMI_CURRENCY_ID":
            '643',
            "WMI_TO_USER_ID":
            '123456789012',
            "WMI_PAYMENT_NO":
            payment.id,
            "WMI_ORDER_ID":
            '12345',
            "WMI_DESCRIPTION":
            'descr',
            "WMI_SUCCESS_URL":
            'http://ya.ru',
            "WMI_FAIL_URL":
            'http://ya.ru',
            "WMI_EXPIRED_DATE":
            '2012-01-01T00:00:00',
            "WMI_CREATE_DATE":
            '2012-01-01T00:00:00',
            "WMI_UPDATE_DATE":
            '2012-01-01T00:00:00',
            "WMI_ORDER_STATE":
            'Accepted',
        }
        d['WMI_SIGNATURE'] = PaymentProcessor.compute_sig(d)
        response = c.post(reverse('getpaid-w1ru-postback'), d)
        print response.content
Exemplo n.º 7
0
 def test_check(self):
     c = Client()
     acc = Account()
     acc.username='******'
     acc.password='******'
     acc.fullname='foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     response = c.get(reverse('getpaid-masterplat-pay'), {'duser': '******', 'dpass': '******', 'cid': '010001', 'uact': 'get_info'})
     print response.content
     print 'check'
Exemplo n.º 8
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username='******'
     acc.password='******'
     acc.fullname='foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     TransactionType.objects.create(name=u'SimpleTerminal', internal_name = 'payments.simpleterminal')
     response = c.get(reverse('getpaid-simpleterminal-pay'), {'uid': '010001', 'sum': '100', 'trans':1})
     print 'pay'
     print response.content
Exemplo n.º 9
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username='******'
     acc.password='******'
     acc.fullname='foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     TransactionType.objects.create(name=u'Materplat', internal_name = 'payments.masterplat')
     response = c.get(reverse('getpaid-masterplat-pay'), {'duser': '******', 'dpass': '******', 'cid': '010001', 'uact': 'payment', 'Term':1, 'trans': 'aabbcc', 'sum':100})
     print 'pay'
     print response.content
Exemplo n.º 10
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username='******'
     acc.password='******'
     acc.fullname='foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     TransactionType.objects.create(name=u'SimpleTerminal', internal_name = 'payments.paypro')
     response = c.get(reverse('getpaid-paypro-pay'), {'pay_id': '12345', 'check': '11111', 'account': '010001', 'date': '2013-08-13 10:55:45', 'pay_amount': '100', 'pay_amount_all': '101'})
     print 'pay'
     print response.content
Exemplo n.º 11
0
 def test_check(self):
     c = Client()
     acc = Account()
     acc.username = '******'
     acc.password = '******'
     acc.fullname = 'foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     response = c.get(reverse('getpaid-masterplat-pay'), {
         'duser': '******',
         'dpass': '******',
         'cid': '010001',
         'uact': 'get_info'
     })
     print response.content
     print 'check'
Exemplo n.º 12
0
    def test_check(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        response = c.post(reverse('getpaid-easypay-pay'), """<Request>
<DateTime>yyyy-MM-ddTHH:mm:ss</DateTime>
<Sign></Sign>
<Check>
<ServiceId>int</ServiceId>
<Account>010001</Account>
</Check>
</Request>""", content_type='text/xml')
        print response.content
Exemplo n.º 13
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username = '******'
     acc.password = '******'
     acc.fullname = 'foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     TransactionType.objects.create(name=u'SimpleTerminal',
                                    internal_name='payments.simpleterminal')
     response = c.get(reverse('getpaid-simpleterminal-pay'), {
         'uid': '010001',
         'sum': '100',
         'trans': 1
     })
     print 'pay'
     print response.content
Exemplo n.º 14
0
    def test_pay(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        response = c.post(reverse('getpaid-platezhkaua-pay'), """<?xml version="1.0" encoding="UTF-8"?>
<commandCall>
    <login>12345</login>
    <password>12345</password>
    <command>check</command>
    <transactionID>204</transactionID>
    <payElementID>1</payElementID>
    <account>010001</account>
</commandCall>""", content_type='text/xml')
        print response.content
Exemplo n.º 15
0
    def test_check(self):
        c = Client()
        acc = Account()
        acc.username='******'
        acc.password='******'
        acc.fullname='foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        response = c.post(reverse('getpaid-rusberbank-pay'), u"""<?xml version="1.0" encoding="utf-8"?>
<request>
<params>
<act>1</act>
<agent_date>2009-04-15T11:22:33</agent_date>
<account>010001</account>
<pay_amount>10000</pay_amount>
<client_name>Иванов Иван Иванович</client_name>
</params>
<sign>853ee7471ac2eb774e850c727998e0cd</sign>
</request>""", content_type='text/xml')
        print response.content
Exemplo n.º 16
0
    def test_pay(self):
        c = Client()
        acc = Account()
        acc.username = '******'
        acc.password = '******'
        acc.fullname = 'foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        response = c.post(reverse('getpaid-platezhkaua-pay'),
                          """<?xml version="1.0" encoding="UTF-8"?>
<commandCall>
    <login>12345</login>
    <password>12345</password>
    <command>check</command>
    <transactionID>204</transactionID>
    <payElementID>1</payElementID>
    <account>010001</account>
</commandCall>""",
                          content_type='text/xml')
        print response.content
Exemplo n.º 17
0
 def test_pay(self):
     c = Client()
     acc = Account()
     acc.username = '******'
     acc.password = '******'
     acc.fullname = 'foouser'
     acc.created = datetime.datetime.now()
     acc.contract = '010001'
     acc.save()
     TransactionType.objects.create(name=u'Materplat',
                                    internal_name='payments.masterplat')
     response = c.get(
         reverse('getpaid-masterplat-pay'), {
             'duser': '******',
             'dpass': '******',
             'cid': '010001',
             'uact': 'payment',
             'Term': 1,
             'trans': 'aabbcc',
             'sum': 100
         })
     print 'pay'
     print response.content
Exemplo n.º 18
0
    def test_check(self):
        c = Client()
        acc = Account()
        acc.username = '******'
        acc.password = '******'
        acc.fullname = 'foouser'
        acc.created = datetime.datetime.now()
        acc.contract = '010001'
        acc.save()
        response = c.post(reverse('getpaid-rusberbank-pay'),
                          u"""<?xml version="1.0" encoding="utf-8"?>
<request>
<params>
<act>1</act>
<agent_date>2009-04-15T11:22:33</agent_date>
<account>010001</account>
<pay_amount>10000</pay_amount>
<client_name>Иванов Иван Иванович</client_name>
</params>
<sign>853ee7471ac2eb774e850c727998e0cd</sign>
</request>""",
                          content_type='text/xml')
        print response.content