本文整理匯總了Python中getpaid.backends.transferuj.PaymentProcessor.online方法的典型用法代碼示例。如果您正苦於以下問題:Python PaymentProcessor.online方法的具體用法?Python PaymentProcessor.online怎麽用?Python PaymentProcessor.online使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類getpaid.backends.transferuj.PaymentProcessor
的用法示例。
在下文中一共展示了PaymentProcessor.online方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_online_wrong_id
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def test_online_wrong_id(self):
self.assertEqual('ID ERR',
PaymentProcessor.online('195.149.229.109', '1111', '1', '', '1',
'123.45', None, None, None, None, None,
'15bb75707d4374bc6e578c0cbf5a7fc7'))
self.assertNotEqual('ID ERR',
PaymentProcessor.online('195.149.229.109', '1234', '1', '', '1',
'123.45', None, None, None, None, None,
'f5f8276fbaa98a6e05b1056ab7c3a589'))
示例2: test_online_wrong_sig
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def test_online_wrong_sig(self):
self.assertEqual('SIG ERR',
PaymentProcessor.online('195.149.229.109', '1234', '1', '', '1',
'123.45', None, None, None, None, None,
'xxx'))
self.assertNotEqual('SIG ERR',
PaymentProcessor.online('195.149.229.109', '1234', '1', '', '1',
'123.45', None, None, None, None, None,
'21b028c2dbdcb9ca272d1cc67ed0574e'))
示例3: test_online_crc_error
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def test_online_crc_error(self):
self.assertEqual('CRC ERR',
PaymentProcessor.online('195.149.229.109', '1234', '1', '',
'99999', '123.45', None, None, None, None,
None, 'f5f8276fbaa98a6e05b1056ab7c3a589'))
self.assertEqual('CRC ERR',
PaymentProcessor.online('195.149.229.109', '1234', '1', '',
'GRRGRRG', '123.45', None, None, None,
None, None,
'6a9e045010c27dfed24774b0afa37d0b'))
示例4: test_online_payment_failure
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def test_online_payment_failure(self):
Payment = apps.get_model('getpaid', 'Payment')
order = Order(name='Test EUR order', total='123.45', currency='PLN')
order.save()
payment = Payment(order=order, amount=order.total, currency=order.currency, backend='getpaid.backends.payu')
payment.save(force_insert=True)
self.assertEqual('TRUE', PaymentProcessor.online('195.149.229.109', '1234', '1', '',
payment.pk, '123.45', '23.45', '',
False, 0, '',
'21b028c2dbdcb9ca272d1cc67ed0574e'))
payment = Payment.objects.get(pk=payment.pk)
self.assertEqual(payment.status, 'failed')
示例5: post
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def post(self, request, *args, **kwargs):
try:
id = request.POST['id']
tr_id = request.POST['tr_id']
tr_date = request.POST['tr_date']
tr_crc = request.POST['tr_crc']
tr_amount = request.POST['tr_amount']
tr_paid = request.POST['tr_paid']
tr_desc = request.POST['tr_desc']
tr_status = request.POST['tr_status']
tr_error = request.POST['tr_error']
tr_email = request.POST['tr_email']
md5sum = request.POST['md5sum']
except KeyError:
logger.warning('Got malformed POST request: %s' % str(request.POST))
return HttpResponse('MALFORMED')
status = PaymentProcessor.online(request.META['REMOTE_ADDR'], id, tr_id, tr_date, tr_crc, tr_amount, tr_paid, tr_desc, tr_status, tr_error, tr_email, md5sum)
return HttpResponse(status)
示例6: test_online_not_allowed_ip
# 需要導入模塊: from getpaid.backends.transferuj import PaymentProcessor [as 別名]
# 或者: from getpaid.backends.transferuj.PaymentProcessor import online [as 別名]
def test_online_not_allowed_ip(self):
self.assertEqual('IP ERR',
PaymentProcessor.online('0.0.0.0', None, None, None, None, None,
None, None, None, None, None, None))
#Tests allowing IP given in settings
with self.settings(GETPAID_BACKENDS_SETTINGS={
'getpaid.backends.transferuj': {'allowed_ip': ('1.1.1.1', '1.2.3.4'), 'key': ''},
}):
self.assertEqual('IP ERR',
PaymentProcessor.online('0.0.0.0', None, None, None, None,
None, None, None, None, None, None,
None))
self.assertNotEqual('IP ERR',
PaymentProcessor.online('1.1.1.1', None, None, None, None,
None, None, None, None, None, None,
None))
self.assertNotEqual('IP ERR',
PaymentProcessor.online('1.2.3.4', None, None, None, None,
None, None, None, None, None, None,
None))
#Tests allowing all IP
with self.settings(GETPAID_BACKENDS_SETTINGS={
'getpaid.backends.transferuj': {'allowed_ip': [], 'key': ''},
}):
self.assertNotEqual('IP ERR',
PaymentProcessor.online('0.0.0.0', None, None, None, None,
None, None, None, None, None, None,
None))
self.assertNotEqual('IP ERR',
PaymentProcessor.online('1.1.1.1', None, None, None, None,
None, None, None, None, None, None,
None))
self.assertNotEqual('IP ERR',
PaymentProcessor.online('1.2.3.4', None, None, None, None,
None, None, None, None, None, None,
None))