---
url: https://laranex.vercel.app/nestjs-myanmar-payments/references/results.md
description: >-
  Property reference for RedirectPayment, FormPayment, QrPayment, AppPayment and
  MiniAppPayment, the result classes returned when a payment is started.
---

# Results

Starting a payment returns one of five classes from `@laranex/myanmar-payments`. Their union is the `PaymentResult` type, and each exposes `flow: PaymentFlow`.

## RedirectPayment

Returned by `kbzPay().pwa()` and `wavePay().initiate()`.

| Property | Type | Description |
|---|---|---|
| `orderId` | `string` | Your order ID |
| `url` | `string` | The gateway page to redirect the customer to |
| `gatewayReference` | `string \| undefined` | The gateway's ID for this attempt (KBZ `prepay_id`, Wave `transaction_id`) |
| `raw` | `Readonly<Record<string, unknown>>` | The gateway's response, for logging |

## FormPayment

Returned by `ayaPay().initiate()` and `cyberSource().hostedCheckout()`.

| Property / Method | Type | Description |
|---|---|---|
| `orderId` | `string` | Your order ID |
| `action` | `string` | The gateway URL the form posts to |
| `fields` | `readonly FormField[]` | The signed hidden fields (`name`, `value`), in signing order. Post them unchanged |
| `enctype` | `string` | The form encoding the gateway expects |
| `field(name)` | `string \| undefined` | The value of one field |
| `values()` | `Record<string, string>` | The fields as an object, e.g. for your own template |
| `toHtml(nonce?)` | `string` | A full HTML page that posts the form on load. Pass your Content-Security-Policy nonce to add it to the inline `<script>` |

`this.payments.autoSubmitUrl(payment)` returns the link to the module's auto-submitting page. It throws when the form route is disabled (`The form route is disabled (formRoute.enabled is false).`) or `formLink.ttlMinutes` is missing; the `FormPayment` itself is still returned by `initiate()` or `hostedCheckout()`.

## QrPayment

Returned by `kbzPay().qr()`, `yomaMmqr().initiate()` and `yomaMmqr().renewQr()`.

| Property / Method | Type | Description |
|---|---|---|
| `orderId` | `string` | Your order ID |
| `qrString` | `string \| undefined` | A QR payload to encode yourself (KBZ Pay) |
| `qrImage` | `string \| undefined` | A base64 image to display as is (Yoma MMQR) |
| `expiresAt` | `Date \| undefined` | When the QR stops being payable |
| `reference` | `string \| undefined` | The gateway's ID for this QR (KBZ `prepay_id`, Yoma `refLabel`) |
| `raw` | `Readonly<Record<string, unknown>>` | The gateway's response, for logging |
| `qrImageDataUri(mimeType = 'image/png')` | `string \| undefined` | `qrImage` as a data URI for `<img src>` |

## AppPayment

Returned by `kbzPay().app()`.

| Property / Method | Type | Description |
|---|---|---|
| `orderId` | `string` | Your order ID |
| `orderInfo` | `string` | The signed order string the SDK expects |
| `sign` | `string` | The signature of `orderInfo` |
| `signType` | `string` | `SHA256` |
| `raw` | `Readonly<Record<string, unknown>>` | The gateway's response, for logging |
| `toJSON()` | `object` | `orderId`, `orderInfo`, `sign`, `signType` for your mobile app |

## MiniAppPayment

Returned by `wavePayMiniApp().payment()`. No request is sent: return it to your mini app page, which hands it unchanged to `WaveJsSDK.paymentModule.makePayment()`.

| Property / Method | Type | Description |
|---|---|---|
| `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` | `readonly MiniAppPaymentItem[]` | The line items, `{ name, amount }` with `amount` an `Amount` |
| `toJSON()` | `object` | Exactly the `makePayment` object: `amount`, `miniAppID`, `merchantRefID`, `orderID`, `callBackUrl`, `hashValue`, `items` (`name`, `amount`), amounts as numbers |
| `toJsonString()` | `string` | The same object as compact JSON, amounts with every digit |

## PaymentFlow

| Value | String | Result |
|---|---|---|
| `PaymentFlow.Redirect` | `redirect` | `RedirectPayment` |
| `PaymentFlow.Form` | `form` | `FormPayment` |
| `PaymentFlow.Qr` | `qr` | `QrPayment` |
| `PaymentFlow.App` | `app` | `AppPayment` |
| `PaymentFlow.MiniApp` | `mini_app` | `MiniAppPayment` |
