Download the PHP package mortogo321/laravel-thai-promptpay without Composer

On this page you can find all versions of the php package mortogo321/laravel-thai-promptpay. 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 laravel-thai-promptpay

Laravel Thai PromptPay

Latest Version on Packagist Total Downloads GitHub License PHP Version Laravel Version Tests GitHub Stars

A Laravel package for generating Thai PromptPay QR codes following the BOT (Bank of Thailand) Thai QR Payment Standard. Supports phone numbers, National ID, Tax ID, and e-Wallet with full validation.

Supported Formats

Type Supported Sub-tag Format Example
Mobile Phone 01 10 digits (06/08/09) 0812345678
National ID 02 13 digits 1234567890123
Tax ID 02 13 digits 0123456789012
e-Wallet 03 15 digits 123456789012345
Bank Account - NOT SUPPORTED BOT spec: reserved

Note: Bank account numbers are NOT supported per BOT specification (marked as "reserved" - no Thai banks have implemented this).

Features

Requirements

Installation

The package will automatically register its service provider.

Publish Configuration (Optional)

Basic Usage

Using Facade

Using Dependency Injection

Validation

Validate Identifier

Validate Amount

Validate Payload Integrity

Type Detection

Get Supported Formats

Display QR Code in Blade

AJAX/API Usage

Available API Endpoints

All endpoints are rate-limited to 60 requests per minute.

Generate QR Code

POST /promptpay/generate

Get Payload Only

POST /promptpay/payload

Download QR Code

POST /promptpay/download

API Response Format

Success Response (200)

Error Response (422)

Identifier Format Details

Phone Numbers

National ID / Tax ID

e-Wallet

API Reference

validate(string $identifier): array

Validate identifier without generating QR.

validateAmount(?float $amount): array

Validate payment amount (max 2 decimal places, max 999,999,999.99).

validatePayload(string $payload): bool

Verify CRC16-CCITT checksum of a complete payload.

getIdentifierType(string $identifier): ?string

Get identifier type ('mobile', 'tax_id', 'ewallet', or null).

isMobileNumber(string $identifier): bool

Check if valid Thai mobile number (06/08/09).

isNationalId(string $identifier): bool

Check if valid National ID with checksum validation.

isTaxId(string $identifier): bool

Check if valid Tax ID (13 digits).

generatePayload(string $identifier, ?float $amount = null): string

Generate PromptPay EMV QR code payload string.

generateQRCode(string $identifier, ?float $amount = null, int $size = 300): string

Generate QR code image as data URI.

generateQRCodeBinary(string $identifier, ?float $amount = null, int $size = 300): string

Generate QR code as binary PNG data.

getSupportedFormats(): array

Get list of all supported identifier formats.

Technical Specification

This package follows the BOT (Bank of Thailand) Thai QR Payment Standard:

Reference: BOT Thai QR Payment Specification

Testing

Test Coverage: 68 tests, 151 assertions

Code Quality

This package uses Laravel Pint for code style.

A pre-commit hook is included to automatically check code style before commits.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Run tests (composer test)
  4. Run linting (composer lint:fix)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

MIT License

Credits

Support

If you discover any issues, please create an issue on GitHub.


All versions of laravel-thai-promptpay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
endroid/qr-code Version ^5.0|^6.0
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 mortogo321/laravel-thai-promptpay contains the following files

Loading the files please wait ...