0004-wip.patch
eopayment/__init__.py | ||
---|---|---|
299 | 299 |
backends is to limit the type of backends if the possible backends are known. |
300 | 300 |
''' |
301 | 301 | |
302 |
last_exception = None |
|
303 | ||
302 | 304 |
for kind, backend in get_backends().items(): |
303 | 305 |
if not hasattr(backend, 'guess'): |
304 | 306 |
continue |
305 | 307 |
if backends and kind not in backends: |
306 | 308 |
continue |
307 |
transaction_id = backend.guess( |
|
308 |
method=method, query_string=query_string, body=body, headers=headers |
|
309 |
) |
|
309 |
try: |
|
310 |
transaction_id = backend.guess( |
|
311 |
method=method, query_string=query_string, body=body, headers=headers |
|
312 |
) |
|
313 |
except Exception as e: |
|
314 |
last_exception = e |
|
315 |
continue |
|
310 | 316 |
if transaction_id: |
311 | 317 |
return kind, transaction_id |
318 |
if last_exception is not None: |
|
319 |
raise last_exception |
|
312 | 320 |
raise BackendNotFound |
313 |
- |