Download the PHP package albertoadolfo27/mpesa_sdk without Composer

On this page you can find all versions of the php package albertoadolfo27/mpesa_sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mpesa_sdk

PT

M-Pesa SDK PHP (Não Oficial)

SDK não oficial para integração com a API da Vodacom M-Pesa Moçambique, desenvolvido em PHP.

Suporte a operações C2B, B2C, B2B, Reversão, Consulta de Transações e Consulta de Nome do Cliente.


Instalação


Requisitos


Como Usar

1. Instanciar a SDK

2. Enviar pagamento C2B

3. Pagamento B2C

4. Pagamento B2B

5. Reverter uma transação

6. Consultar transação

7. Consultar nome do cliente

Códigos de Resposta

Todos os métodos retornam um objeto contendo:

Verificando o Código de Resposta

O SDK define uma série de constantes na classe MPesaResponseCode para facilitar a verificação dos códigos de resposta retornados pela API. Isso torna seu código mais legível e seguro contra erros de digitação.

Exemplo de Uso:

Aqui está a tabela de códigos de resposta da classe MPesaResponseCode

Constante Código Descrição
SUCCESSINS-0Transação bem-sucedida
CREATEDINS-0Transação criada com sucesso
INTERNAL_ERRORINS-1Erro interno
INVALID_API_KEYINS-2Chave de API inválida
USER_NOT_ACTIVEINS-4Usuário não está ativo
TRANSACTION_CANCELLEDINS-5Transação cancelada
TRANSACTION_FAILEDINS-6Falha na transação
REQUEST_TIMEOUTINS-9Tempo limite excedido
DUPLICATE_TRANSACTIONINS-10Transação duplicada
INVALID_SHORTCODEINS-13Código de serviço inválido
INVALID_REFERENCEINS-14Referência inválida
INVALID_AMOUNTINS-15Valor inválido
TEMPORARY_OVERLOADINS-16Sobrecarga temporária
INVALID_TRANSACTION_REFINS-17Referência de transação inválida
INVALID_TRANSACTION_IDINS-18ID da transação inválido
INVALID_THIRD_PARTY_REFINS-19Referência de terceiro inválida
MISSING_PARAMETERSINS-20Parâmetros ausentes
PARAMETER_VALIDATION_FAILEDINS-21Validação de parâmetro falhou
INVALID_OPERATION_TYPEINS-22Tipo de operação inválida
UNKNOWN_STATUSINS-23Status desconhecido
INVALID_INITIATOR_IDINS-24ID do iniciador inválido
INVALID_CREDENTIALINS-25Credencial inválida
NOT_AUTHORIZEDINS-26Não autorizado
DIRECT_DEBIT_MISSINGINS-993Débito direto ausente
DIRECT_DEBIT_EXISTSINS-994Débito direto já existe
CUSTOMER_PROFILE_ISSUEINS-995Problemas com perfil do cliente
ACCOUNT_NOT_ACTIVEINS-996Conta inativa
LINKING_TRANSACTION_MISSINGINS-997Transação de vinculação ausente
INVALID_MARKETINS-998Mercado inválido
INITIATOR_AUTH_ERRORINS-2001Erro de autenticação do iniciador
INVALID_RECEIVERINS-2002Destinatário inválido
INSUFFICIENT_BALANCEINS-2006Saldo insuficiente
INVALID_MSISDNINS-2051Número MSISDN inválido
INVALID_LANGUAGE_CODEINS-2057Código de idioma inválido

Gerando Referência Única

Para facilitar a criação de uma referência única a ser usada no parâmetro thirdPartyReference, o SDK oferece o método auxiliar:

Estrutura do Projeto


To-Do


Autor

Alberto Jordane Adolfo
Alberto Jordane Adolfo


Licença

Este projeto está licenciado sob a licença MIT.






EN

M-Pesa PHP SDK (Unofficial)

Unofficial SDK for integrating with the Vodacom M-Pesa Mozambique API, built in PHP.

Supports C2B, B2C, B2B operations, Reversal, Transaction Status, and Customer Name Lookup.


Installation


Requirements


How to Use

1. Instantiate the SDK

2. Send C2B Payment

3. B2C Payment

4. B2B Payment

5. Reverse a Transaction

6. Check Transaction Status

7. Get Customer Name

Response Codes

All methods return an object like:


Checking the Response Code

The SDK defines a set of constants in the MPesaResponseCode class to simplify checking the response codes returned by the API. This makes your code more readable and helps prevent typos.

Example:

See the Full List of Response Codes from MPesaResponseCode

(The HTML table you asked for earlier contains the full list.)


Generating a Unique Reference

To easily generate a unique value to be used in the thirdPartyReference parameter, you can use the helper method provided by the SDK:


Project Structure


To-Do


Author

Alberto Jordane Adolfo
Alberto Jordane Adolfo


License

This project is licensed under the MIT license.


All versions of mpesa_sdk with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package albertoadolfo27/mpesa_sdk contains the following files

Loading the files please wait ....