Mozambique Payments icon

Mozambique Payments

Gateway unificado para pagamentos M-Pesa e E-Mola em Moçambique

Overview

The "Mozambique Payments" node provides a unified gateway to handle mobile payments in Mozambique through two popular providers: M-Pesa and E-Mola. It supports three main operations:

  • Process Payment: Initiates a payment transaction using either M-Pesa or E-Mola based on the phone number prefix or user selection.
  • Validate Phone: Checks if a given phone number is valid for the selected provider or auto-detects the provider from the phone number prefix.
  • Generate Reference: Creates a unique payment reference string that can be used to identify transactions.

This node is beneficial for businesses or applications operating in Mozambique that want to integrate mobile money payments seamlessly without managing separate integrations for each provider. For example, an e-commerce platform can use this node to process customer payments via mobile wallets, validate customer phone numbers before processing, and generate unique references for tracking payments.

Properties

Name Meaning
Operation The action to perform: Process Payment, Validate Phone, or Generate Reference.
Provider The mobile payment provider to use: M-Pesa, E-Mola, or Auto-Detect based on phone prefix.
Phone Number The 9-digit phone number to validate or use for payment (format: 8xxxxxxxx).
Amount (Only for Process Payment) The payment amount in Mozambican Metical (MZN), between 1 and 1,250,000.
Reference (Only for Process Payment) Optional transaction reference; if empty, it will be generated automatically.

Output

The node outputs JSON objects with different structures depending on the operation:

  • Process Payment:

    {
      "success": true,
      "provider": "mpesa" | "emola",
      "reference": "string",        // Transaction reference
      "phone": "string",            // Normalized 9-digit phone number
      "amount": number,             // Payment amount in MZN
      "timestamp": "ISO8601 string",
      "response": { ... }           // Raw response from the payment API
    }
    

    If the payment fails, the output includes "success": false and an "error" message.

  • Validate Phone:

    {
      "valid": true | false,
      "phone": "string",            // Normalized 9-digit phone number
      "provider": "mpesa" | "emola" | "auto",
      "message": "string",          // Validation result message
      "timestamp": "ISO8601 string"
    }
    
  • Generate Reference:

    {
      "reference": "string",        // Generated unique reference string
      "provider": "mpesa" | "emola" | "payment",
      "timestamp": "ISO8601 string"
    }
    

The node does not output binary data.

Dependencies

  • Requires an API key credential with client ID, client secret, base URL, and wallet IDs for both M-Pesa and E-Mola.
  • Uses OAuth2 client credentials flow to obtain access tokens from the payment gateway.
  • Makes HTTP POST requests to the payment provider's API endpoints.
  • Requires proper configuration of the credential with valid API keys and URLs.

Troubleshooting

  • Invalid Phone Number Length: The phone number must have exactly 9 digits. Remove any non-digit characters before input.
  • Unrecognized Phone Prefix: When using "Auto-Detect" provider, the phone number must start with 84 or 85 for M-Pesa, or 86 or 87 for E-Mola. Otherwise, validation or payment will fail.
  • Provider Mismatch: If you select a specific provider, ensure the phone number prefix matches the expected prefixes (84/85 for M-Pesa, 86/87 for E-Mola).
  • Amount Out of Range: Payment amounts must be between 1 and 1,250,000 MZN.
  • Authentication Errors: Failure to obtain an OAuth token usually indicates invalid or missing API credentials.
  • API Request Failures: Network issues or incorrect API endpoint URLs can cause errors during payment processing.

To resolve these issues, verify phone number formats, provider selections, amount ranges, and ensure API credentials are correctly configured.

Links and References

Discussion