API Reference¶
Top-Level tekmomoapi¶
Momo Developer APIs SDK.
-
class
tekmomoapi.CollectionAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPICollection API Handler.
-
get_payment_request_status(reference_id, x_target_environment='sandbox')[source]¶ Get Payment Request Status.
-
remote_caller_class¶ alias of
tekmomoapi.collection.RemoteCaller
-
request_payment(x_reference_id: str, payment_request: tekmomoapi.collection.RequestToPay, x_callback_url='', x_target_environment='sandbox')[source]¶ Get This operation is used to request a payment from a consumer (Payer). The payer will be asked to authorize the payment. The transaction will be executed once the payer has authorized the payment. The requesttopay will be in status PENDING until the transaction is authorized or declined by the payer or it is timed out by the system.
Status of the transaction can be validated by using the GET /requesttopay/<resourceId>Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example, validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- payment_request –
- x_callback_url – URL to the server where the callback should be sent.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns:
-
-
class
tekmomoapi.RemittanceAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPIRemittance API Handler.
-
get_transfer_status(reference_id, x_target_environment='sandbox')[source]¶ Get This operation is used to get the status of a transfer.
X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
remote_caller_class¶ alias of
tekmomoapi.remittance.RemoteCaller
-
transfer(x_reference_id, transfer_obj, x_callback_url='', x_target_environment='sandbox')[source]¶ Transfer operation is used to transfer an amount from the own account to a payee account.
<br> Status of the transaction can validated by using the GET /transfer/{referenceId}
Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
-
class
tekmomoapi.DisbursementAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPIDisbursement API Handler.
-
get_transfer_status(reference_id, x_target_environment='sandbox')[source]¶ Get This operation is used to get the status of a transfer.
X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
remote_caller_class¶
-
transfer(x_reference_id, transfer_obj, x_callback_url='', x_target_environment='sandbox')[source]¶ Transfer operation is used to transfer an amount from the own account to a payee account.
<br> Status of the transaction can validated by using the GET /transfer/{referenceId}
Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
-
tekmomoapi.UserProvisioningAPI¶
-
tekmomoapi.get_user_id_and_api_key(subscriptionKey: str, base_url: str = 'https://sandbox.momodeveloper.mtn.com') → dict[source]¶ Return a key,value pair of user_id and apiKey.
Parameters: - subscription_key – Your Subscription Key.
- base_url – The sandbox base url default https://sandbox.momodeveloper.mtn.com.
-
tekmomoapi.get_collection_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.get_disbursement_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.get_remittance_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.get_disbursement_transfer_obj(amount: str, currency: str, externalId: str, payee: tekmomoapi.disbursements.Party, payerMessage: str, payeeNote: str)[source]¶ Return a Transfer obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payee – DParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
-
tekmomoapi.get_remittance_transfer_obj(amount: str, currency: str, externalId: str, payee: tekmomoapi.remittance.Party, payerMessage: str, payeeNote: str)[source]¶ Return a Transfer obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payee – RParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
-
tekmomoapi.get_payment_request_obj(amount: str, currency: str, externalId: str, payer: tekmomoapi.collection.Party, payerMessage: str, payeeNote: str)[source]¶ Return a PaymentRequest obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payer – CParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
-
tekmomoapi.get_sandbox_test_args(subscriptionKey: str, base_url: str = 'https://sandbox.momodeveloper.mtn.com') → dict[source]¶ Return some sandbox default sane test configuration values.
Parameters: - subscription_key – Your Subscription Key.
- base_url – The sandbox base url default https://sandbox.momodeveloper.mtn.com.
Returns: a key,value pair of user_id,base_url,x_target_environment, apiKey,subscriptionKey.”
-
tekmomoapi.DParty¶ alias of
tekmomoapi.disbursements.Party
-
tekmomoapi.RParty¶ alias of
tekmomoapi.remittance.Party
-
tekmomoapi.CParty¶ alias of
tekmomoapi.collection.Party
Collections¶
Implements the client for collection.
-
class
tekmomoapi.collection.Balance(availableBalance: Optional[str] = None, currency: Optional[str] = None)[source]¶ Bases:
objectThe available balance of the account
-
class
tekmomoapi.collection.ErrorReason(code: Optional[str] = None, message: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.Party(partyIdType: Optional[str] = None, partyId: Optional[str] = None)[source]¶ Bases:
objectParty identifies a account holder in the wallet platform. Party consists of two parameters, type and partyId. Each type have its own validation of the partyId<br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid
-
class
tekmomoapi.collection.PreApproval(payer: Optional[tekmomoapi.collection.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.PreApprovalResult(payer: Optional[tekmomoapi.collection.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.collection.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.RemoteCaller(url_prefix: str, auth: Optional[requests.auth.AuthBase] = None)[source]¶ Bases:
objectExecutes the remote calls to the server.
-
get_v1_0_account_balance(ocp_apim_subscription_key: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.collection.Balance[source]¶ Get the balance of the account.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok
-
get_v1_0_accountholder_accountholderidtype_accountholderid_active(ocp_apim_subscription_key: str, account_holder_id: str, account_holder_id_type: str, x_target_environment: str, authorization: Optional[str] = None) → bytes[source]¶ Operation is used to check if an account holder is registered and active in the system.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- account_holder_id – The party number. Validated according to the party ID type (case Sensitive). <br> msisdn - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> email - Validated to be a valid e-mail format. Validated with IsEmail<br> party_code - UUID of the party. Validated with IsUuid
- account_holder_id_type – Specifies the type of the party ID. Allowed values [msisdn, email, party_code]. <br> accountHolderId should explicitly be in small letters.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok. True if account holder is registered and active, false if the account holder is not active or not found
-
requesttopay_POST(ocp_apim_subscription_key: str, x_reference_id: str, x_target_environment: str, authorization: Optional[str] = None, x_callback_url: Optional[str] = None, request_to_pay: Optional[tekmomoapi.collection.RequestToPay] = None) → bytes[source]¶ - This operation is used to request a payment from a consumer (Payer). The payer will be asked to authorize the payment. The transaction will be executed once the payer has authorized the payment. The requesttopay will be in status PENDING until the transaction is authorized or declined by the payer or it is timed out by the system.
- Status of the transaction can be validated by using the GET /requesttopay/<resourceId>
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example, validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
- x_callback_url – URL to the server where the callback should be sent.
- request_to_pay –
Returns:
-
requesttopay_referenceId_GET(ocp_apim_subscription_key: str, reference_id: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.collection.RequestToPayResult[source]¶ This operation is used to get the status of a request to pay. X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: OK. Note that a failed request to pay will be returned with this status too. The ‘status’ of the RequestToPayResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
token_POST(ocp_apim_subscription_key: str, authorization: str) → tekmomoapi.collection.TokenPost200ApplicationJsonResponse[source]¶ This operation is used to create an access token which can then be used to authorize and authenticate towards the other end-points of the API.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- authorization – Basic authentication header containing API user ID and API key. Should be sent in as B64 encoded.
Returns: OK
-
-
class
tekmomoapi.collection.RequestToPay(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.collection.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.RequestToPayResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.collection.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.collection.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.TokenPost200ApplicationJsonResponse(access_token: Optional[str] = None, token_type: Optional[str] = None, expires_in: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.TokenPost401ApplicationJsonResponse(error: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.Transfer(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.collection.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.collection.TransferResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.collection.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.collection.ErrorReason] = None)[source]¶ Bases:
object
-
tekmomoapi.collection.balance_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.Balance[source]¶ Generates an instance of Balance from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Balance
- path – path to the object used for debugging
Returns: parsed instance of Balance
-
tekmomoapi.collection.balance_to_jsonable(balance: tekmomoapi.collection.Balance, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Balance.
Parameters: - balance – instance of Balance to be JSON-ized
- path – path to the balance used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.boolean_result_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.BooleanResult[source]¶ Generates an instance of BooleanResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of BooleanResult
- path – path to the object used for debugging
Returns: parsed instance of BooleanResult
-
tekmomoapi.collection.boolean_result_to_jsonable(boolean_result: tekmomoapi.collection.BooleanResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of BooleanResult.
Parameters: - boolean_result – instance of BooleanResult to be JSON-ized
- path – path to the boolean_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.error_reason_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.ErrorReason[source]¶ Generates an instance of ErrorReason from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ErrorReason
- path – path to the object used for debugging
Returns: parsed instance of ErrorReason
-
tekmomoapi.collection.error_reason_to_jsonable(error_reason: tekmomoapi.collection.ErrorReason, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ErrorReason.
Parameters: - error_reason – instance of ErrorReason to be JSON-ized
- path – path to the error_reason used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.from_obj(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given obj along the expected types.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – to the object used for debugging
Returns: the converted object
-
tekmomoapi.collection.new_balance() → tekmomoapi.collection.Balance[source]¶ Generates an instance of Balance with default values.
-
tekmomoapi.collection.new_boolean_result() → tekmomoapi.collection.BooleanResult[source]¶ Generates an instance of BooleanResult with default values.
-
tekmomoapi.collection.new_error_reason() → tekmomoapi.collection.ErrorReason[source]¶ Generates an instance of ErrorReason with default values.
-
tekmomoapi.collection.new_party() → tekmomoapi.collection.Party[source]¶ Generates an instance of Party with default values.
-
tekmomoapi.collection.new_pre_approval() → tekmomoapi.collection.PreApproval[source]¶ Generates an instance of PreApproval with default values.
-
tekmomoapi.collection.new_pre_approval_result() → tekmomoapi.collection.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult with default values.
-
tekmomoapi.collection.new_request_to_pay() → tekmomoapi.collection.RequestToPay[source]¶ Generates an instance of RequestToPay with default values.
-
tekmomoapi.collection.new_request_to_pay_result() → tekmomoapi.collection.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult with default values.
-
tekmomoapi.collection.new_token_post200_application_json_response() → tekmomoapi.collection.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse with default values.
-
tekmomoapi.collection.new_token_post401_application_json_response() → tekmomoapi.collection.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse with default values.
-
tekmomoapi.collection.new_transfer() → tekmomoapi.collection.Transfer[source]¶ Generates an instance of Transfer with default values.
-
tekmomoapi.collection.new_transfer_result() → tekmomoapi.collection.TransferResult[source]¶ Generates an instance of TransferResult with default values.
-
tekmomoapi.collection.party_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.Party[source]¶ Generates an instance of Party from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Party
- path – path to the object used for debugging
Returns: parsed instance of Party
-
tekmomoapi.collection.party_to_jsonable(party: tekmomoapi.collection.Party, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Party.
Parameters: - party – instance of Party to be JSON-ized
- path – path to the party used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.pre_approval_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.PreApproval[source]¶ Generates an instance of PreApproval from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApproval
- path – path to the object used for debugging
Returns: parsed instance of PreApproval
-
tekmomoapi.collection.pre_approval_result_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApprovalResult
- path – path to the object used for debugging
Returns: parsed instance of PreApprovalResult
-
tekmomoapi.collection.pre_approval_result_to_jsonable(pre_approval_result: tekmomoapi.collection.PreApprovalResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApprovalResult.
Parameters: - pre_approval_result – instance of PreApprovalResult to be JSON-ized
- path – path to the pre_approval_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.pre_approval_to_jsonable(pre_approval: tekmomoapi.collection.PreApproval, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApproval.
Parameters: - pre_approval – instance of PreApproval to be JSON-ized
- path – path to the pre_approval used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.request_to_pay_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.RequestToPay[source]¶ Generates an instance of RequestToPay from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPay
- path – path to the object used for debugging
Returns: parsed instance of RequestToPay
-
tekmomoapi.collection.request_to_pay_result_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPayResult
- path – path to the object used for debugging
Returns: parsed instance of RequestToPayResult
-
tekmomoapi.collection.request_to_pay_result_to_jsonable(request_to_pay_result: tekmomoapi.collection.RequestToPayResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPayResult.
Parameters: - request_to_pay_result – instance of RequestToPayResult to be JSON-ized
- path – path to the request_to_pay_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.request_to_pay_to_jsonable(request_to_pay: tekmomoapi.collection.RequestToPay, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPay.
Parameters: - request_to_pay – instance of RequestToPay to be JSON-ized
- path – path to the request_to_pay used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.to_jsonable(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given object along the expected types to a JSON-able representation.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – path to the object used for debugging
Returns: JSON-able representation of the object
-
tekmomoapi.collection.token_post200_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost200ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost200ApplicationJsonResponse
-
tekmomoapi.collection.token_post200_application_json_response_to_jsonable(token_post200_application_json_response: tekmomoapi.collection.TokenPost200ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost200ApplicationJsonResponse.
Parameters: - token_post200_application_json_response – instance of TokenPost200ApplicationJsonResponse to be JSON-ized
- path – path to the token_post200_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.token_post401_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost401ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost401ApplicationJsonResponse
-
tekmomoapi.collection.token_post401_application_json_response_to_jsonable(token_post401_application_json_response: tekmomoapi.collection.TokenPost401ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost401ApplicationJsonResponse.
Parameters: - token_post401_application_json_response – instance of TokenPost401ApplicationJsonResponse to be JSON-ized
- path – path to the token_post401_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.transfer_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.Transfer[source]¶ Generates an instance of Transfer from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Transfer
- path – path to the object used for debugging
Returns: parsed instance of Transfer
-
tekmomoapi.collection.transfer_result_from_obj(obj: Any, path: str = '') → tekmomoapi.collection.TransferResult[source]¶ Generates an instance of TransferResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TransferResult
- path – path to the object used for debugging
Returns: parsed instance of TransferResult
-
tekmomoapi.collection.transfer_result_to_jsonable(transfer_result: tekmomoapi.collection.TransferResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TransferResult.
Parameters: - transfer_result – instance of TransferResult to be JSON-ized
- path – path to the transfer_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.collection.transfer_to_jsonable(transfer: tekmomoapi.collection.Transfer, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Transfer.
Parameters: - transfer – instance of Transfer to be JSON-ized
- path – path to the transfer used for debugging
Returns: a JSON-able representation
Disbursements¶
Implements the client for disbursements.
-
class
tekmomoapi.disbursements.Balance(availableBalance: Optional[str] = None, currency: Optional[str] = None)[source]¶ Bases:
objectThe available balance of the account
-
class
tekmomoapi.disbursements.ErrorReason(code: Optional[str] = None, message: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.Party(partyIdType: Optional[str] = None, partyId: Optional[str] = None)[source]¶ Bases:
objectParty identifies a account holder in the wallet platform. Party consists of two parameters, type and partyId. Each type have its own validation of the partyId<br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid
-
class
tekmomoapi.disbursements.PreApproval(payer: Optional[tekmomoapi.disbursements.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.PreApprovalResult(payer: Optional[tekmomoapi.disbursements.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.disbursements.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.RemoteCaller(url_prefix: str, auth: Optional[requests.auth.AuthBase] = None)[source]¶ Bases:
objectExecutes the remote calls to the server.
-
get_v1_0_account_balance(ocp_apim_subscription_key: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.disbursements.Balance[source]¶ Get the balance of the account.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok
-
get_v1_0_accountholder_accountholderidtype_accountholderid_active(ocp_apim_subscription_key: str, account_holder_id: str, account_holder_id_type: str, x_target_environment: str, authorization: Optional[str] = None) → bytes[source]¶ Operation is used to check if an account holder is registered and active in the system.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- account_holder_id – The party number. Validated according to the party id type. <br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid
- account_holder_id_type – Specifies the type of the party id. Allowed values [msisdn, email, party_code].
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok. True if account holder is registered and active, false if the account holder is not active or not found found
-
token_POST(ocp_apim_subscription_key: str, authorization: str) → tekmomoapi.disbursements.TokenPost200ApplicationJsonResponse[source]¶ This operation is used to create an access token which can then be used to authorize and authenticate towards the other end-points of the API.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- authorization – Basic authentication header containing API user ID and API key. Should be sent in as B64 encoded.
Returns: OK
-
transfer_POST(ocp_apim_subscription_key: str, x_reference_id: str, x_target_environment: str, authorization: Optional[str] = None, x_callback_url: Optional[str] = None, transfer: Optional[tekmomoapi.disbursements.Transfer] = None) → bytes[source]¶ Transfer operation is used to transfer an amount from the owner’s account to a payee account.<br> Status of the transaction can be validated by using the GET /transfer/{referenceId}
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID of the created ‘request-to-pay’ transaction. This ID is used for e.g. validating the status of the request. Universal Unique ID for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
transfer_referenceId_GET(ocp_apim_subscription_key: str, reference_id: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.disbursements.TransferResult[source]¶ This operation is used to get the status of a transfer. X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
-
class
tekmomoapi.disbursements.RequestToPay(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.disbursements.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.RequestToPayResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.disbursements.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.disbursements.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.TokenPost200ApplicationJsonResponse(access_token: Optional[str] = None, token_type: Optional[str] = None, expires_in: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.TokenPost401ApplicationJsonResponse(error: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.Transfer(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.disbursements.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.disbursements.TransferResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.disbursements.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.disbursements.ErrorReason] = None)[source]¶ Bases:
object
-
tekmomoapi.disbursements.balance_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.Balance[source]¶ Generates an instance of Balance from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Balance
- path – path to the object used for debugging
Returns: parsed instance of Balance
-
tekmomoapi.disbursements.balance_to_jsonable(balance: tekmomoapi.disbursements.Balance, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Balance.
Parameters: - balance – instance of Balance to be JSON-ized
- path – path to the balance used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.boolean_result_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.BooleanResult[source]¶ Generates an instance of BooleanResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of BooleanResult
- path – path to the object used for debugging
Returns: parsed instance of BooleanResult
-
tekmomoapi.disbursements.boolean_result_to_jsonable(boolean_result: tekmomoapi.disbursements.BooleanResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of BooleanResult.
Parameters: - boolean_result – instance of BooleanResult to be JSON-ized
- path – path to the boolean_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.error_reason_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.ErrorReason[source]¶ Generates an instance of ErrorReason from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ErrorReason
- path – path to the object used for debugging
Returns: parsed instance of ErrorReason
-
tekmomoapi.disbursements.error_reason_to_jsonable(error_reason: tekmomoapi.disbursements.ErrorReason, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ErrorReason.
Parameters: - error_reason – instance of ErrorReason to be JSON-ized
- path – path to the error_reason used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.from_obj(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given obj along the expected types.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – to the object used for debugging
Returns: the converted object
-
tekmomoapi.disbursements.new_balance() → tekmomoapi.disbursements.Balance[source]¶ Generates an instance of Balance with default values.
-
tekmomoapi.disbursements.new_boolean_result() → tekmomoapi.disbursements.BooleanResult[source]¶ Generates an instance of BooleanResult with default values.
-
tekmomoapi.disbursements.new_error_reason() → tekmomoapi.disbursements.ErrorReason[source]¶ Generates an instance of ErrorReason with default values.
-
tekmomoapi.disbursements.new_party() → tekmomoapi.disbursements.Party[source]¶ Generates an instance of Party with default values.
-
tekmomoapi.disbursements.new_pre_approval() → tekmomoapi.disbursements.PreApproval[source]¶ Generates an instance of PreApproval with default values.
-
tekmomoapi.disbursements.new_pre_approval_result() → tekmomoapi.disbursements.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult with default values.
-
tekmomoapi.disbursements.new_request_to_pay() → tekmomoapi.disbursements.RequestToPay[source]¶ Generates an instance of RequestToPay with default values.
-
tekmomoapi.disbursements.new_request_to_pay_result() → tekmomoapi.disbursements.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult with default values.
-
tekmomoapi.disbursements.new_token_post200_application_json_response() → tekmomoapi.disbursements.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse with default values.
-
tekmomoapi.disbursements.new_token_post401_application_json_response() → tekmomoapi.disbursements.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse with default values.
-
tekmomoapi.disbursements.new_transfer() → tekmomoapi.disbursements.Transfer[source]¶ Generates an instance of Transfer with default values.
-
tekmomoapi.disbursements.new_transfer_result() → tekmomoapi.disbursements.TransferResult[source]¶ Generates an instance of TransferResult with default values.
-
tekmomoapi.disbursements.party_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.Party[source]¶ Generates an instance of Party from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Party
- path – path to the object used for debugging
Returns: parsed instance of Party
-
tekmomoapi.disbursements.party_to_jsonable(party: tekmomoapi.disbursements.Party, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Party.
Parameters: - party – instance of Party to be JSON-ized
- path – path to the party used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.pre_approval_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.PreApproval[source]¶ Generates an instance of PreApproval from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApproval
- path – path to the object used for debugging
Returns: parsed instance of PreApproval
-
tekmomoapi.disbursements.pre_approval_result_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApprovalResult
- path – path to the object used for debugging
Returns: parsed instance of PreApprovalResult
-
tekmomoapi.disbursements.pre_approval_result_to_jsonable(pre_approval_result: tekmomoapi.disbursements.PreApprovalResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApprovalResult.
Parameters: - pre_approval_result – instance of PreApprovalResult to be JSON-ized
- path – path to the pre_approval_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.pre_approval_to_jsonable(pre_approval: tekmomoapi.disbursements.PreApproval, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApproval.
Parameters: - pre_approval – instance of PreApproval to be JSON-ized
- path – path to the pre_approval used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.request_to_pay_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.RequestToPay[source]¶ Generates an instance of RequestToPay from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPay
- path – path to the object used for debugging
Returns: parsed instance of RequestToPay
-
tekmomoapi.disbursements.request_to_pay_result_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPayResult
- path – path to the object used for debugging
Returns: parsed instance of RequestToPayResult
-
tekmomoapi.disbursements.request_to_pay_result_to_jsonable(request_to_pay_result: tekmomoapi.disbursements.RequestToPayResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPayResult.
Parameters: - request_to_pay_result – instance of RequestToPayResult to be JSON-ized
- path – path to the request_to_pay_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.request_to_pay_to_jsonable(request_to_pay: tekmomoapi.disbursements.RequestToPay, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPay.
Parameters: - request_to_pay – instance of RequestToPay to be JSON-ized
- path – path to the request_to_pay used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.to_jsonable(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given object along the expected types to a JSON-able representation.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – path to the object used for debugging
Returns: JSON-able representation of the object
-
tekmomoapi.disbursements.token_post200_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost200ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost200ApplicationJsonResponse
-
tekmomoapi.disbursements.token_post200_application_json_response_to_jsonable(token_post200_application_json_response: tekmomoapi.disbursements.TokenPost200ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost200ApplicationJsonResponse.
Parameters: - token_post200_application_json_response – instance of TokenPost200ApplicationJsonResponse to be JSON-ized
- path – path to the token_post200_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.token_post401_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost401ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost401ApplicationJsonResponse
-
tekmomoapi.disbursements.token_post401_application_json_response_to_jsonable(token_post401_application_json_response: tekmomoapi.disbursements.TokenPost401ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost401ApplicationJsonResponse.
Parameters: - token_post401_application_json_response – instance of TokenPost401ApplicationJsonResponse to be JSON-ized
- path – path to the token_post401_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.transfer_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.Transfer[source]¶ Generates an instance of Transfer from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Transfer
- path – path to the object used for debugging
Returns: parsed instance of Transfer
-
tekmomoapi.disbursements.transfer_result_from_obj(obj: Any, path: str = '') → tekmomoapi.disbursements.TransferResult[source]¶ Generates an instance of TransferResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TransferResult
- path – path to the object used for debugging
Returns: parsed instance of TransferResult
-
tekmomoapi.disbursements.transfer_result_to_jsonable(transfer_result: tekmomoapi.disbursements.TransferResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TransferResult.
Parameters: - transfer_result – instance of TransferResult to be JSON-ized
- path – path to the transfer_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.disbursements.transfer_to_jsonable(transfer: tekmomoapi.disbursements.Transfer, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Transfer.
Parameters: - transfer – instance of Transfer to be JSON-ized
- path – path to the transfer used for debugging
Returns: a JSON-able representation
Remittances¶
Implements the client for remittance.
-
class
tekmomoapi.remittance.Balance(availableBalance: Optional[str] = None, currency: Optional[str] = None)[source]¶ Bases:
objectThe available balance of the account
-
class
tekmomoapi.remittance.ErrorReason(code: Optional[str] = None, message: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.Party(partyIdType: Optional[str] = None, partyId: Optional[str] = None)[source]¶ Bases:
objectParty identifies a account holder in the wallet platform. Party consists of two parameters, type and partyId. Each type have its own validation of the partyId<br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid
-
class
tekmomoapi.remittance.PreApproval(payer: Optional[tekmomoapi.remittance.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.PreApprovalResult(payer: Optional[tekmomoapi.remittance.Party] = None, payerCurrency: Optional[str] = None, payerMessage: Optional[str] = None, validityTime: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.remittance.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.RemoteCaller(url_prefix: str, auth: Optional[requests.auth.AuthBase] = None)[source]¶ Bases:
objectExecutes the remote calls to the server.
-
get_v1_0_account_balance(ocp_apim_subscription_key: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.remittance.Balance[source]¶ Get the balance of the account.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok
-
get_v1_0_accountholder_accountholderidtype_accountholderid_active(ocp_apim_subscription_key: str, account_holder_id: str, account_holder_id_type: str, x_target_environment: str, authorization: Optional[str] = None) → bytes[source]¶ Operation is used to check if an account holder is registered and active in the system.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- account_holder_id – The party number. Validated according to the party id type. <br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid
- account_holder_id_type – Specifies the type of the party id. Allowed values [msisdn, email, party_code].
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: Ok. True if account holder is registered and active, false if the account holder is not active or not found found
-
token_POST(ocp_apim_subscription_key: str, authorization: str) → tekmomoapi.remittance.TokenPost200ApplicationJsonResponse[source]¶ This operation is used to create an access token which can then be used to authorize and authenticate towards the other end-points of the API.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- authorization – Basic authentication header containing API user ID and API key. Should be sent in as B64 encoded.
Returns: OK
-
transfer_POST(ocp_apim_subscription_key: str, x_reference_id: str, x_target_environment: str, authorization: Optional[str] = None, x_callback_url: Optional[str] = None, transfer: Optional[tekmomoapi.remittance.Transfer] = None) → bytes[source]¶ Transfer operation is used to transfer an amount from the own account to a payee account.<br> Status of the transaction can validated by using the GET /transfer/{referenceId}
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
transfer_referenceId_GET(ocp_apim_subscription_key: str, reference_id: str, x_target_environment: str, authorization: Optional[str] = None) → tekmomoapi.remittance.TransferResult[source]¶ This operation is used to get the status of a transfer. X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- authorization – Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
-
class
tekmomoapi.remittance.RequestToPay(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.remittance.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.RequestToPayResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payer: Optional[tekmomoapi.remittance.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.remittance.ErrorReason] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.TokenPost200ApplicationJsonResponse(access_token: Optional[str] = None, token_type: Optional[str] = None, expires_in: Optional[int] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.TokenPost401ApplicationJsonResponse(error: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.Transfer(amount: Optional[str] = None, currency: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.remittance.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.remittance.TransferResult(amount: Optional[str] = None, currency: Optional[str] = None, financialTransactionId: Optional[str] = None, externalId: Optional[str] = None, payee: Optional[tekmomoapi.remittance.Party] = None, payerMessage: Optional[str] = None, payeeNote: Optional[str] = None, status: Optional[str] = None, reason: Optional[tekmomoapi.remittance.ErrorReason] = None)[source]¶ Bases:
object
-
tekmomoapi.remittance.balance_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.Balance[source]¶ Generates an instance of Balance from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Balance
- path – path to the object used for debugging
Returns: parsed instance of Balance
-
tekmomoapi.remittance.balance_to_jsonable(balance: tekmomoapi.remittance.Balance, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Balance.
Parameters: - balance – instance of Balance to be JSON-ized
- path – path to the balance used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.boolean_result_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.BooleanResult[source]¶ Generates an instance of BooleanResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of BooleanResult
- path – path to the object used for debugging
Returns: parsed instance of BooleanResult
-
tekmomoapi.remittance.boolean_result_to_jsonable(boolean_result: tekmomoapi.remittance.BooleanResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of BooleanResult.
Parameters: - boolean_result – instance of BooleanResult to be JSON-ized
- path – path to the boolean_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.error_reason_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.ErrorReason[source]¶ Generates an instance of ErrorReason from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ErrorReason
- path – path to the object used for debugging
Returns: parsed instance of ErrorReason
-
tekmomoapi.remittance.error_reason_to_jsonable(error_reason: tekmomoapi.remittance.ErrorReason, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ErrorReason.
Parameters: - error_reason – instance of ErrorReason to be JSON-ized
- path – path to the error_reason used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.from_obj(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given obj along the expected types.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – to the object used for debugging
Returns: the converted object
-
tekmomoapi.remittance.new_balance() → tekmomoapi.remittance.Balance[source]¶ Generates an instance of Balance with default values.
-
tekmomoapi.remittance.new_boolean_result() → tekmomoapi.remittance.BooleanResult[source]¶ Generates an instance of BooleanResult with default values.
-
tekmomoapi.remittance.new_error_reason() → tekmomoapi.remittance.ErrorReason[source]¶ Generates an instance of ErrorReason with default values.
-
tekmomoapi.remittance.new_party() → tekmomoapi.remittance.Party[source]¶ Generates an instance of Party with default values.
-
tekmomoapi.remittance.new_pre_approval() → tekmomoapi.remittance.PreApproval[source]¶ Generates an instance of PreApproval with default values.
-
tekmomoapi.remittance.new_pre_approval_result() → tekmomoapi.remittance.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult with default values.
-
tekmomoapi.remittance.new_request_to_pay() → tekmomoapi.remittance.RequestToPay[source]¶ Generates an instance of RequestToPay with default values.
-
tekmomoapi.remittance.new_request_to_pay_result() → tekmomoapi.remittance.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult with default values.
-
tekmomoapi.remittance.new_token_post200_application_json_response() → tekmomoapi.remittance.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse with default values.
-
tekmomoapi.remittance.new_token_post401_application_json_response() → tekmomoapi.remittance.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse with default values.
-
tekmomoapi.remittance.new_transfer() → tekmomoapi.remittance.Transfer[source]¶ Generates an instance of Transfer with default values.
-
tekmomoapi.remittance.new_transfer_result() → tekmomoapi.remittance.TransferResult[source]¶ Generates an instance of TransferResult with default values.
-
tekmomoapi.remittance.party_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.Party[source]¶ Generates an instance of Party from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Party
- path – path to the object used for debugging
Returns: parsed instance of Party
-
tekmomoapi.remittance.party_to_jsonable(party: tekmomoapi.remittance.Party, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Party.
Parameters: - party – instance of Party to be JSON-ized
- path – path to the party used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.pre_approval_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.PreApproval[source]¶ Generates an instance of PreApproval from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApproval
- path – path to the object used for debugging
Returns: parsed instance of PreApproval
-
tekmomoapi.remittance.pre_approval_result_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.PreApprovalResult[source]¶ Generates an instance of PreApprovalResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PreApprovalResult
- path – path to the object used for debugging
Returns: parsed instance of PreApprovalResult
-
tekmomoapi.remittance.pre_approval_result_to_jsonable(pre_approval_result: tekmomoapi.remittance.PreApprovalResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApprovalResult.
Parameters: - pre_approval_result – instance of PreApprovalResult to be JSON-ized
- path – path to the pre_approval_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.pre_approval_to_jsonable(pre_approval: tekmomoapi.remittance.PreApproval, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PreApproval.
Parameters: - pre_approval – instance of PreApproval to be JSON-ized
- path – path to the pre_approval used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.request_to_pay_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.RequestToPay[source]¶ Generates an instance of RequestToPay from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPay
- path – path to the object used for debugging
Returns: parsed instance of RequestToPay
-
tekmomoapi.remittance.request_to_pay_result_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.RequestToPayResult[source]¶ Generates an instance of RequestToPayResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of RequestToPayResult
- path – path to the object used for debugging
Returns: parsed instance of RequestToPayResult
-
tekmomoapi.remittance.request_to_pay_result_to_jsonable(request_to_pay_result: tekmomoapi.remittance.RequestToPayResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPayResult.
Parameters: - request_to_pay_result – instance of RequestToPayResult to be JSON-ized
- path – path to the request_to_pay_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.request_to_pay_to_jsonable(request_to_pay: tekmomoapi.remittance.RequestToPay, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of RequestToPay.
Parameters: - request_to_pay – instance of RequestToPay to be JSON-ized
- path – path to the request_to_pay used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.to_jsonable(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given object along the expected types to a JSON-able representation.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – path to the object used for debugging
Returns: JSON-able representation of the object
-
tekmomoapi.remittance.token_post200_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.TokenPost200ApplicationJsonResponse[source]¶ Generates an instance of TokenPost200ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost200ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost200ApplicationJsonResponse
-
tekmomoapi.remittance.token_post200_application_json_response_to_jsonable(token_post200_application_json_response: tekmomoapi.remittance.TokenPost200ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost200ApplicationJsonResponse.
Parameters: - token_post200_application_json_response – instance of TokenPost200ApplicationJsonResponse to be JSON-ized
- path – path to the token_post200_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.token_post401_application_json_response_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.TokenPost401ApplicationJsonResponse[source]¶ Generates an instance of TokenPost401ApplicationJsonResponse from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TokenPost401ApplicationJsonResponse
- path – path to the object used for debugging
Returns: parsed instance of TokenPost401ApplicationJsonResponse
-
tekmomoapi.remittance.token_post401_application_json_response_to_jsonable(token_post401_application_json_response: tekmomoapi.remittance.TokenPost401ApplicationJsonResponse, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TokenPost401ApplicationJsonResponse.
Parameters: - token_post401_application_json_response – instance of TokenPost401ApplicationJsonResponse to be JSON-ized
- path – path to the token_post401_application_json_response used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.transfer_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.Transfer[source]¶ Generates an instance of Transfer from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of Transfer
- path – path to the object used for debugging
Returns: parsed instance of Transfer
-
tekmomoapi.remittance.transfer_result_from_obj(obj: Any, path: str = '') → tekmomoapi.remittance.TransferResult[source]¶ Generates an instance of TransferResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TransferResult
- path – path to the object used for debugging
Returns: parsed instance of TransferResult
-
tekmomoapi.remittance.transfer_result_to_jsonable(transfer_result: tekmomoapi.remittance.TransferResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TransferResult.
Parameters: - transfer_result – instance of TransferResult to be JSON-ized
- path – path to the transfer_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.remittance.transfer_to_jsonable(transfer: tekmomoapi.remittance.Transfer, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of Transfer.
Parameters: - transfer – instance of Transfer to be JSON-ized
- path – path to the transfer used for debugging
Returns: a JSON-able representation
Scaffold¶
Scaffold API Module.
To simplify usage of the underlying Remote APIs Namely: - Collections - Disbursements - Remittances - Sandbox User Provisioning.
-
tekmomoapi.scaffold.get_sandbox_test_args(subscriptionKey: str, base_url: str = 'https://sandbox.momodeveloper.mtn.com') → dict[source]¶ Return some sandbox default sane test configuration values.
Parameters: - subscription_key – Your Subscription Key.
- base_url – The sandbox base url default https://sandbox.momodeveloper.mtn.com.
Returns: a key,value pair of user_id,base_url,x_target_environment, apiKey,subscriptionKey.”
-
class
tekmomoapi.scaffold.BaseAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
objectBase API Handler Scaffold.
-
basic_auth_str¶ Get Authorization String of type Basic.
-
bearer_auth_str¶ Get Authorization String of type Bearer.
-
get_account_balance(x_target_environment='sandbox')[source]¶ Get the balance of the account.
Parameters: x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction. Returns: Balance obj.
-
is_account_active(account_uuid, account_type, x_target_environment='sandbox')[source]¶ Operation is used to check if an account holder is registered and active in the system.
Parameters: - account_uuid – The party number. Validated according to the party ID type (case Sensitive). <br> msisdn - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> email - Validated to be a valid e-mail format. Validated with IsEmail <br> party_code - UUID of the party. Validated with IsUuid
- account_type – Specifies the type of the party ID. Allowed values [msisdn, email, party_code]. <br> accountHolderId should explicitly be in small letters.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns: True if account holder is registered and active, False if the account holder is not active or not found
-
remote_caller_class= None¶
-
-
class
tekmomoapi.scaffold.RemittanceAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPIRemittance API Handler.
-
get_transfer_status(reference_id, x_target_environment='sandbox')[source]¶ Get This operation is used to get the status of a transfer.
X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
remote_caller_class¶ alias of
tekmomoapi.remittance.RemoteCaller
-
transfer(x_reference_id, transfer_obj, x_callback_url='', x_target_environment='sandbox')[source]¶ Transfer operation is used to transfer an amount from the own account to a payee account.
<br> Status of the transaction can validated by using the GET /transfer/{referenceId}
Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
-
class
tekmomoapi.scaffold.DisbursementAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPIDisbursement API Handler.
-
get_transfer_status(reference_id, x_target_environment='sandbox')[source]¶ Get This operation is used to get the status of a transfer.
X-Reference-Id that was passed in the post is used as reference to the request.
Parameters: - reference_id – UUID of transaction to get result. Reference id used when creating the request to pay.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns: OK. Note that a failed transfer will be returned with this status too. The ‘status’ of the TransferResult can be used to determine the outcome of the request. The ‘reason’ field can be used to retrieve a cause in case of failure.
-
remote_caller_class¶
-
transfer(x_reference_id, transfer_obj, x_callback_url='', x_target_environment='sandbox')[source]¶ Transfer operation is used to transfer an amount from the own account to a payee account.
<br> Status of the transaction can validated by using the GET /transfer/{referenceId}
Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
- x_callback_url – URL to the server where the callback should be sent.
- transfer –
Returns:
-
-
class
tekmomoapi.scaffold.CollectionAPI(subscriptionKey: str, base_url: str, user_id: str, apiKey: str, *args, **kwargs)[source]¶ Bases:
tekmomoapi.scaffold.BaseAPICollection API Handler.
-
get_payment_request_status(reference_id, x_target_environment='sandbox')[source]¶ Get Payment Request Status.
-
remote_caller_class¶ alias of
tekmomoapi.collection.RemoteCaller
-
request_payment(x_reference_id: str, payment_request: tekmomoapi.collection.RequestToPay, x_callback_url='', x_target_environment='sandbox')[source]¶ Get This operation is used to request a payment from a consumer (Payer). The payer will be asked to authorize the payment. The transaction will be executed once the payer has authorized the payment. The requesttopay will be in status PENDING until the transaction is authorized or declined by the payer or it is timed out by the system.
Status of the transaction can be validated by using the GET /requesttopay/<resourceId>Parameters: - x_reference_id – Format - UUID. Recource ID of the created request to pay transaction. This ID is used, for example, validating the status of the request. ‘Universal Unique ID’ for the transaction generated using UUID version 4.
- payment_request –
- x_callback_url – URL to the server where the callback should be sent.
- x_target_environment – The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
Returns:
-
-
tekmomoapi.scaffold.DParty¶ alias of
tekmomoapi.disbursements.Party
-
tekmomoapi.scaffold.RParty¶ alias of
tekmomoapi.remittance.Party
-
tekmomoapi.scaffold.CParty¶ alias of
tekmomoapi.collection.Party
-
tekmomoapi.scaffold.PaymentRequest¶ alias of
tekmomoapi.collection.RequestToPay
-
tekmomoapi.scaffold.DTransfer¶ alias of
tekmomoapi.disbursements.Transfer
-
tekmomoapi.scaffold.RTransfer¶ alias of
tekmomoapi.remittance.Transfer
-
tekmomoapi.scaffold.get_collection_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.scaffold.get_disbursement_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.scaffold.get_remittance_party_obj(partyIdType: str, partyId: str)[source]¶ Return a Party obj from args and kwargs.
Parameters: - partyIdType – Specifies the type of the party ID. Allowed values [msisdn, email, party_code].<br>
- partyId – Specifies the party ID, should explicitly be in small letters.
-
tekmomoapi.scaffold.get_disbursement_transfer_obj(amount: str, currency: str, externalId: str, payee: tekmomoapi.disbursements.Party, payerMessage: str, payeeNote: str)[source]¶ Return a Transfer obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payee – DParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
-
tekmomoapi.scaffold.get_remittance_transfer_obj(amount: str, currency: str, externalId: str, payee: tekmomoapi.remittance.Party, payerMessage: str, payeeNote: str)[source]¶ Return a Transfer obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payee – RParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
-
tekmomoapi.scaffold.get_payment_request_obj(amount: str, currency: str, externalId: str, payer: tekmomoapi.collection.Party, payerMessage: str, payeeNote: str)[source]¶ Return a PaymentRequest obj from args and kwargs.
Parameters: - amount – Amount to Transfer,
- currency – Currency Code,
- externalId – External Identifier for the transaction,
- payer – CParty(partyIdType,partyId),
- payerMessage – payer Message,
- payeeNote – payee Note,
UserProvisioning¶
Implements the client for userprovisioning.
-
class
tekmomoapi.userprovisioning.ApiUser(providerCallbackHost: Optional[str] = None)[source]¶ Bases:
objectThe create API user information
-
class
tekmomoapi.userprovisioning.ApiUserKeyResult(apiKey: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.userprovisioning.ApiUserResult(providerCallbackHost: Optional[str] = None, paymentServerUrl: Optional[tekmomoapi.userprovisioning.PaymentServerUrl] = None, targetEnvironment: Optional[tekmomoapi.userprovisioning.TargetEnvironment] = None)[source]¶ Bases:
objectThe API user information
-
class
tekmomoapi.userprovisioning.ErrorReason(code: Optional[str] = None, message: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.userprovisioning.PaymentServerUrl(apiKey: Optional[str] = None)[source]¶ Bases:
object
-
class
tekmomoapi.userprovisioning.RemoteCaller(url_prefix: str, auth: Optional[requests.auth.AuthBase] = None)[source]¶ Bases:
objectExecutes the remote calls to the server.
-
get_v1_0_apiuser(ocp_apim_subscription_key: str, x_reference_id: str) → dict[source]¶ Used to get API user information.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID for the API user to be created. UUID version 4 is required.
Returns: Ok
-
post_v1_0_apiuser(ocp_apim_subscription_key: str, x_reference_id: str, api_user: Optional[tekmomoapi.userprovisioning.ApiUser] = None) → bytes[source]¶ Used to create an API user in the sandbox target environment.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID for the API user to be created. UUID version 4 is required.
- api_user –
Returns:
-
post_v1_0_apiuser_apikey(ocp_apim_subscription_key: str, x_reference_id: str) → bytes[source]¶ Use to create an API key for an API user in the sandbox target environment.
Parameters: - ocp_apim_subscription_key – Subscription key which provides access to this API.
- x_reference_id – Format - UUID. Recource ID for the API user to be created. UUID version 4 is required.
Returns:
-
-
class
tekmomoapi.userprovisioning.TargetEnvironment(apiKey: Optional[str] = None)[source]¶ Bases:
object
-
tekmomoapi.userprovisioning.api_user_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.ApiUser[source]¶ Generates an instance of ApiUser from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ApiUser
- path – path to the object used for debugging
Returns: parsed instance of ApiUser
-
tekmomoapi.userprovisioning.api_user_key_result_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.ApiUserKeyResult[source]¶ Generates an instance of ApiUserKeyResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ApiUserKeyResult
- path – path to the object used for debugging
Returns: parsed instance of ApiUserKeyResult
-
tekmomoapi.userprovisioning.api_user_key_result_to_jsonable(api_user_key_result: tekmomoapi.userprovisioning.ApiUserKeyResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ApiUserKeyResult.
Parameters: - api_user_key_result – instance of ApiUserKeyResult to be JSON-ized
- path – path to the api_user_key_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.api_user_result_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.ApiUserResult[source]¶ Generates an instance of ApiUserResult from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ApiUserResult
- path – path to the object used for debugging
Returns: parsed instance of ApiUserResult
-
tekmomoapi.userprovisioning.api_user_result_to_jsonable(api_user_result: tekmomoapi.userprovisioning.ApiUserResult, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ApiUserResult.
Parameters: - api_user_result – instance of ApiUserResult to be JSON-ized
- path – path to the api_user_result used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.api_user_to_jsonable(api_user: tekmomoapi.userprovisioning.ApiUser, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ApiUser.
Parameters: - api_user – instance of ApiUser to be JSON-ized
- path – path to the api_user used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.error_reason_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.ErrorReason[source]¶ Generates an instance of ErrorReason from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of ErrorReason
- path – path to the object used for debugging
Returns: parsed instance of ErrorReason
-
tekmomoapi.userprovisioning.error_reason_to_jsonable(error_reason: tekmomoapi.userprovisioning.ErrorReason, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of ErrorReason.
Parameters: - error_reason – instance of ErrorReason to be JSON-ized
- path – path to the error_reason used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.from_obj(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given obj along the expected types.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – to the object used for debugging
Returns: the converted object
-
tekmomoapi.userprovisioning.new_api_user() → tekmomoapi.userprovisioning.ApiUser[source]¶ Generates an instance of ApiUser with default values.
-
tekmomoapi.userprovisioning.new_api_user_key_result() → tekmomoapi.userprovisioning.ApiUserKeyResult[source]¶ Generates an instance of ApiUserKeyResult with default values.
-
tekmomoapi.userprovisioning.new_api_user_result() → tekmomoapi.userprovisioning.ApiUserResult[source]¶ Generates an instance of ApiUserResult with default values.
-
tekmomoapi.userprovisioning.new_error_reason() → tekmomoapi.userprovisioning.ErrorReason[source]¶ Generates an instance of ErrorReason with default values.
-
tekmomoapi.userprovisioning.new_payment_server_url() → tekmomoapi.userprovisioning.PaymentServerUrl[source]¶ Generates an instance of PaymentServerUrl with default values.
-
tekmomoapi.userprovisioning.new_target_environment() → tekmomoapi.userprovisioning.TargetEnvironment[source]¶ Generates an instance of TargetEnvironment with default values.
-
tekmomoapi.userprovisioning.payment_server_url_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.PaymentServerUrl[source]¶ Generates an instance of PaymentServerUrl from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of PaymentServerUrl
- path – path to the object used for debugging
Returns: parsed instance of PaymentServerUrl
-
tekmomoapi.userprovisioning.payment_server_url_to_jsonable(payment_server_url: tekmomoapi.userprovisioning.PaymentServerUrl, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of PaymentServerUrl.
Parameters: - payment_server_url – instance of PaymentServerUrl to be JSON-ized
- path – path to the payment_server_url used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.target_environment_from_obj(obj: Any, path: str = '') → tekmomoapi.userprovisioning.TargetEnvironment[source]¶ Generates an instance of TargetEnvironment from a dictionary object.
Parameters: - obj – a JSON-ed dictionary object representing an instance of TargetEnvironment
- path – path to the object used for debugging
Returns: parsed instance of TargetEnvironment
-
tekmomoapi.userprovisioning.target_environment_to_jsonable(target_environment: tekmomoapi.userprovisioning.TargetEnvironment, path: str = '') → MutableMapping[str, Any][source]¶ Generates a JSON-able mapping from an instance of TargetEnvironment.
Parameters: - target_environment – instance of TargetEnvironment to be JSON-ized
- path – path to the target_environment used for debugging
Returns: a JSON-able representation
-
tekmomoapi.userprovisioning.to_jsonable(obj: Any, expected: List[type], path: str = '') → Any[source]¶ Checks and converts the given object along the expected types to a JSON-able representation.
Parameters: - obj – to be converted
- expected – list of types representing the (nested) structure
- path – path to the object used for debugging
Returns: JSON-able representation of the object