Download the PHP package pongsit/scb without Composer

On this page you can find all versions of the php package pongsit/scb. 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 scb

pongsit/scb

SCB Partners API (Thai PromptPay bill-payment QR) for PHP 7.4+. No framework, no dependencies beyond ext-curl and ext-json — drop it into a plain-PHP app, a Laravel app, or anything else.

Why this exists

Every project that takes money re-implements the same four calls, and the same mistake keeps coming with it: trusting the webhook body. The callback endpoint is public and SCB signs nothing, so anyone can POST {"amount": "5000.00"}. This package never reads the amount from the request — it re-fetches the transaction from SCB over an authenticated call and compares that amount to what your application says is due.

Install

Configure

env decides the host. Nothing else changes between environments, so a project can run against sandbox until the day it goes live.

Show a QR

ref1/ref2/ref3 must be 1–20 characters of A-Z0-9; the package uppercases and validates them instead of letting SCB reject the call later.

Creating a QR moves no money — safe to call while testing.

Take the callback

Implement three methods so the package can check the payment without knowing anything about your schema:

Then the endpoint SCB calls:

handle() returns a WebhookResult with one of:

status meaning settle() called
settled amount confirmed and sufficient yes
already_settled SCB retried a callback no
underpaid SCB confirms less than is due no
unknown_reference expectedAmount() returned null no
not_found SCB has no record of the transaction no
invalid_payload body was not usable JSON no

The package acknowledges every case with SCB's expected resCode 00. Retrying will not turn an underpayment into a full one, and an unacknowledged callback is retried forever.

Verify a payment yourself

Prefer byReference(). byTransactionId() needs the payer's bank code, which is not always 014 — a payer on another bank will not be found if you hardcode it.

Rules the package enforces

Tests

No network, no database — covers the money rules above.


All versions of scb with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-curl Version *
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 pongsit/scb contains the following files

Loading the files please wait ...