Results
Starting a payment returns one of five final classes in Laranex\PhpMyanmarPayments\Results, with read-only properties, each implementing PaymentResult. Properties a gateway did not provide are null.
RedirectPayment
Returned by $kbz->pwa() and $wave->initiate().
| Property / Method | Type | Description |
|---|---|---|
flow() | PaymentFlow | PaymentFlow::Redirect |
orderId | string | Your order ID, as sent to the gateway |
url | string | The gateway page to redirect the customer to |
gatewayReference | ?string | The gateway's ID for this attempt (KBZ prepay_id, Wave transaction_id) |
raw | array | The gateway's response, for logging |
FormPayment
Returned by $aya->initiate() and $cs->hostedCheckout().
| Property / Method | Type | Description |
|---|---|---|
flow() | PaymentFlow | PaymentFlow::Form |
orderId | string | Your order ID |
action | string | The gateway URL the form posts to |
fields | array<string, string> | The signed hidden fields, name => value, in order. Post them unchanged |
enctype | string | The encoding the gateway expects; application/x-www-form-urlencoded unless the gateway needs another (AYA: multipart/form-data) |
toHtml(?string $nonce = null) | string | A complete, escaped page that submits the form on load. Pass your Content-Security-Policy nonce to add it to the inline <script>; an empty nonce adds none |
field($name) | ?string | One field's value |
values() | array<string, string> | The fields as an array |
autoSubmitUrl | ?string | Link to a page that renders the form. null unless set with withAutoSubmitUrl() |
withAutoSubmitUrl($url) | FormPayment | A copy with autoSubmitUrl set |
QrPayment
Returned by $kbz->qr(), $yoma->initiate() and $yoma->renewQr().
| Property / Method | Type | Description |
|---|---|---|
flow() | PaymentFlow | PaymentFlow::Qr |
orderId | string | Your order ID |
qrString | ?string | A QR payload to encode yourself (KBZ Pay) |
qrImage | ?string | A base64 image to display as is (Yoma MMQR) |
expiresAt | ?DateTimeImmutable | When the QR stops being payable; null when the gateway sets no limit |
reference | ?string | The gateway's ID for this QR (Yoma refLabel, passed to status(); KBZ prepay_id) |
raw | array | The gateway's response, for logging |
qrImageDataUri($mimeType = 'image/png') | ?string | qrImage as a data URI. null when there is no image |
AppPayment
Returned by $kbz->app().
| Property / Method | Type | Description |
|---|---|---|
flow() | PaymentFlow | PaymentFlow::App |
orderId | string | Your order ID |
orderInfo | string | The signed order string the SDK expects |
sign | string | The signature of orderInfo |
signType | string | The signature algorithm, SHA256 |
raw | array | The gateway's response; left out of toArray() |
toArray() | array<string, string> | ['orderId', 'orderInfo', 'sign', 'signType'], the values your app needs |
MiniAppPayment
Returned by $wavePayMiniApp->payment(). No request is sent: pass toArray() or toJson() to your mini app page, which hands it unchanged to WaveJsSDK.paymentModule.makePayment().
| Property / Method | Type | Description |
|---|---|---|
flow() | PaymentFlow | PaymentFlow::MiniApp |
orderId | string | Your order ID (orderID) |
amount | Amount | The signed total, in whole kyat |
miniAppId | string | The configured mini app ID (miniAppID) |
merchantReferenceId | string | Your ID for this attempt (merchantRefID) |
callbackUrl | string | The signed callback URL (callBackUrl) |
hashValue | string | The payload's hash (hashValue) |
items | list<array{name: string, amount: Amount}> | The line items |
toArray() / jsonSerialize() | array | Exactly the makePayment object: amount, miniAppID, merchantRefID, orderID, callBackUrl, hashValue, items (name, amount), amounts as int |
toJson() | string | The same object as JSON, amounts as JSON integers with every digit (no PHP_INT_MAX limit) |
PaymentFlow
A string-backed enum in Laranex\PhpMyanmarPayments\Enums, so $payment->flow()->value is redirect, form, qr, app or mini_app.
| Case | Value | Class |
|---|---|---|
PaymentFlow::Redirect | redirect | RedirectPayment |
PaymentFlow::Form | form | FormPayment |
PaymentFlow::Qr | qr | QrPayment |
PaymentFlow::App | app | AppPayment |
PaymentFlow::MiniApp | mini_app | MiniAppPayment |
raw values are decoded JSON: numbers keep their exact text as strings, never a float, so json_encode($payment->raw) logs them without rounding.
Every result class takes its properties as named constructor arguments, so you can build one in your own tests, e.g. new RedirectPayment(orderId: 'ORDER_1', url: 'https://…').