API

This part of the documentation covers all the interfaces of WireXfers.

Payment Providers

IPizza

class wirexfers.providers.ipizza.IPizzaProviderBase(user, keychain, endpoint, extra_info={})

Base class for IPizza protocol provider.

Protocol
IPizza
KeyChain
IPizzaKeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

IPizza Providers

class wirexfers.providers.ipizza.EEDanskeProvider(user, keychain, endpoint, extra_info={})
Danske Bank A/S Eesti filiaal
Protocol
IPizza
KeyChain
KeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

class wirexfers.providers.ipizza.EEKrediidipankProvider(user, keychain, endpoint, extra_info={})
AS Eesti Krediidipank
Protocol
IPizza
KeyChain
KeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

class wirexfers.providers.ipizza.EELHVProvider(user, keychain, endpoint, extra_info={})
AS LHV Pank
Protocol
IPizza
KeyChain
KeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

class wirexfers.providers.ipizza.EESEBProvider(user, keychain, endpoint, extra_info={})
AS SEB Pank
Protocol
IPizza
KeyChain
KeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

class wirexfers.providers.ipizza.EESwedBankProvider(user, keychain, endpoint, extra_info={})
Protocol
IPizza
KeyChain
KeyChain
Supported return urls:
  • return
Supported protocol version:
  • 008
parse_response(form, success=True)

Parse and return payment response.

Solo/TUPAS

Solo/TUPAS providers

class wirexfers.providers.tupas.EENordeaProvider(user, keychain, endpoint, extra_info={})
Nordea Bank Finland Plc Eesti / AS Nordea Finance Estonia
Protocol
Solo/TUPAS
KeyChain
KeyChain
Supported return urls:
  • cancel - user cancels payment
  • reject - bank rejects payment (due to insufficient funds, ...)
  • return - payment is successful
Supported protocol version:
  • 0003
parse_response(form, success=True)

Parse and return payment response.

Base Classes

class wirexfers.providers.KeyChainBase

Base class for protocol-specific key handling.

class wirexfers.providers.ProviderBase(user, keychain, endpoint, extra_info={})

Base class for all payment providers.

endpoint = None

Endpoint address used to initiate payment requests.

extra_info = None

Dictionary containing extra user-supplied information. Can be used for supplying provider url, etc.

keychain = None

Protocol-specific keychain implementation - wirexfers.providers.KeyChainBase

parse_response(data)

Parse the payment request.

Parameters:form – Raw payment response data.
user = None

User id for payment processor.

ProviderBase.__call__(payment, return_urls)

Create and return a payment request.

Parameters:payment (PaymentInfo) – payment information
Return type:PaymentRequest
class wirexfers.PaymentRequest(provider, info, return_urls)

PaymentRequest class.

Parameters:
  • provider (ProviderBase.) – Payment provider
  • info (PaymentInfo.) – Payment information
  • return_urls (Dict) – Dictionary of return URLs. Depends on the specific provider, but generally {'return': ... } is required.

Raises ValueError when invalid configuration is detected.

form = None

List containing (name, value) tuples for HTML-form setup.

info = None

PaymentInfo containing various payment information (sum, etc..)

provider = None

ProviderBase that handles the payment request.

class wirexfers.PaymentResponse(provider, data, successful=False)

PaymentResponse class.

data = None

Dictionary containing payment-related data, specific to provider

provider = None

ProviderBase that handles the payment request.

successful = None

Whether payment response is successful (some providers don’t provide this status, therefore allow setting it from the view)

Exceptions

wirexfers.exc

Exceptions used with WireXfers.

The base exception class is WireXfersError

copyright:
  1. 2012-2014 Priit Laes
license:

ISC, see LICENSE for more details.

exception wirexfers.exc.InvalidResponseError

Bases: wirexfers.exc.WireXfersError

Raised when an invalid payment response data is supplied to the response parser.

exception wirexfers.exc.WireXfersError

Bases: exceptions.Exception

Generic error class.

Utility Classes

class wirexfers.PaymentInfo(amount, message, refnum)

Payment information required for PaymentRequest.

amount = None

Payment amount as string, uses . as decimal point separator.

message = None

Message used for payment description.

refnum = None

Reference number.

Utility Functions

wirexfers.utils

This module provides utility functions that are used within WireXfers, but might be also useful externally.

copyright:
  1. 2012-2014 Priit Laes
license:

ISC, see LICENSE for more details.

wirexfers.utils.load_key(path, password=None)

Import an RSA key (private or public half).

Parameters:
  • path (string) – path to key half.
  • password (string or None) – password for private key.
Return type:

Crypto.PublicKey.RSA._RSAobj

wirexfers.utils.ref_731(n)

Reference number calculator. Returns reference number calculated using 7-3-1 algorithm used in Estonian banks.

Parameters:n (string) – base number (client id, etc)
Return type:string