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:
0003
-
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:
0003
-
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:
0003
-
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 paymentreject- 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 that all provider implementations derive from.
-
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)¶ Parses the payment request.
Parameters: form – Raw payment response data.
-
user= None¶ User id for payment processor.
-
-
ProviderBase.__call__(payment, return_urls)¶ Creates and returns a payment request.
Parameters: payment ( PaymentInfo) – payment informationReturn 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
ValueErrorwhen invalid configuration is detected.-
form= None¶ List containing
(name, value)tuples for HTML-form setup.
-
info= None¶ PaymentInfocontaining various payment information (sum, etc..)
-
provider= None¶ ProviderBasethat handles the payment request.
- provider (
-
class
wirexfers.PaymentResponse(provider, data, successful=False)¶ PaymentResponse class.
-
data= None¶ Dictionary containing payment-related data, specific to provider
-
provider= None¶ ProviderBasethat 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
-
exception
wirexfers.exc.InvalidResponseError¶ Bases:
wirexfers.exc.WireXfersErrorRaised when an invalid payment response data is supplied to the response parser.
-
exception
wirexfers.exc.WireXfersError¶ Bases:
exceptions.ExceptionGeneric 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.
-
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