Download the PHP package myanmyanpay/mmpay-php-sdk without Composer

On this page you can find all versions of the php package myanmyanpay/mmpay-php-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 mmpay-php-sdk

MMPay PHP SDK

A professional, comprehensive PHP client library for integrating with the MMPay Payment Gateway. This SDK mimics the official Node.js SDK structure, providing robust utilities for payment creation, handshake authentication, and secure webhook verification.

📦 1. Installation

Requires PHP 7.4 or higher.

Install the package via Composer:


🚀 2. Configuration

To start, initialize the SDK with your Merchant credentials found in the MMPay Dashboard.

Implementation

Configuration Parameters

Parameter Type Required Description
appId string Yes Your unique Application ID.
publishableKey string Yes Public key used for identification.
secretKey string Yes Private key used for HMAC SHA256 signing.
apiBaseUrl string Yes The base URL for the MMPay API.

🛠 3. Create a Payment

pay This method automatically handles the required handshake and signature generation.

Method Signature

Implementation

Request Body (payload structure)

Field Type Required Description Example
orderId string Yes Your generated order ID for the order or system initiating the payment. "ORD-3983833"
amount number Yes The total transaction amount. 1500.50
callbackUrl string No The URL where the payment gateway will send transaction status updates. "https://yourserver.com/webhook"
currency string No The currency code (e.g., 'MMK'). "MMK"
customMessage string No Your Customization String
items Array<Object> No List of items included in the purchase. [{name: "Hat", amount: 1000, quantity: 1}]

Item Object

Field Type Description
name string The name of the item.
amount number The unit price of the item.
quantity number The number of units purchased.

Response Body Code (201)


🛠 4. Retrieve Payment

This method is used to retrieve a payment and MMQR related events.

Method Signature

Implementation

Request Body (payload structure)

Field Type Required Description Example
orderId string Yes Your generated order ID for the order or system initiating the payment. "ORD-3983833"

Response Body Code (200)


🛠 5. Cancel Payment

This method is used to cancel a payment and all of its MMQR releated instances

Method Signature

Implementation

Request Body (payload structure)

Field Type Required Description Example
orderId string Yes Your generated order ID for the order or system initiating the payment. "ORD-3983833"

Response Body Code (200)


🔐 6. Handling Webhooks

To secure your webhook endpoint that receives callbacks from the MMPay server, use this event listener to handle the events. The listen performs the mandatory Signature and Nonce verification and emits events

Handling callbacks

Incoming HTTP POST Parameters

Header

Field Name Type Required Description
Content-Type string Yes 'application/json'
X-Mmpay-Signature string Yes '34834890vfgh9hnf94irfg_48932i4rt90349849'
X-Mmpay-Nonce string Yes '94843943949349'

Body

Field Name Type Required Description
orderId string Yes Unique identifier for the specific order.
amount number Yes The transaction amount.
currency string Yes The 3-letter currency code (e.g., MMK, USD).
vendor string Yes Identifier for the vendor initiating the request.
method 'QR', 'PIN', 'PWA', 'CARD' Yes Identifier for the method.
status 'PENDING','SUCCESS','FAILED','REFUNDED', 'EXPIRED', 'CANCELLED' Yes Current status of the transaction.
condition 'PRESTINE', 'TOUCHED', 'EXPIRED', 'DIRTY' Yes Used QR Code scan again or not
transactionRefId string Yes The reference ID generated by the payment provider after success payment
vendorQrRefId string Yes The MMQR reference ID generated by the payment provider.
callbackUrl string No Optional URL to receive webhooks or updates.
customMessage string No User provided custom message

Example Implementation With Laravel

In Laravel, you should use the Request object to fetch headers and the raw content.


⚠️ 7. Error Handling

The mmpayx throws standard PHP \Exception when errors occur (e.g., network issues, API validation errors, or handshake failures).


⚠️ 8. Error Codes

HMac Layer (SERVER Side)

Code Description
KA0001 Bearer Token Not Included In Your Request
KA0002 API Key Not 'LIVE'
KA0003 Signature mismatch
KA0004 Internal Server Error ( Talk to our support immediately fot this )
KA0005 IP Not whitelisted
429 Ratelimit hit only 1000 request / minute allowed

JWT Layer (SERVER Side)

Code Description
BA001 Btoken is nonce one time token is not included
BA002 Btoken one time nonce mismatch
BA000 Internal Server Error ( Talk to our support immediately fot this )
429 Ratelimit hit only 1000 request / minute allowed

Response Codes

Code Status Description
201 Created Transaction initiated successfully. Response contains QR code URL/details.
401 Unauthorized Invalid or missing Publishable Key.
400 Bad Request Missing required body fields (validated by schema, if implemented).
503 Service Unavailable Upstream payment API failed or is unreachable.
500 Internal Server Error General server error during payment initiation.

📄 License

MIT License.


All versions of mmpay-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.0
ext-json Version *
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 myanmyanpay/mmpay-php-sdk contains the following files

Loading the files please wait ...