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

# Results

Starting a payment returns a pointer to one of five types in `github.com/laranex/go-myanmar-payments/v4` (imported as `myanmarpayments`). All implement `PaymentResult` and expose `Flow() PaymentFlow`.

## RedirectPayment

Returned by `KbzPay()` → `PWA()` and `WavePay()` → `Initiate()`.

| Field | Type | Description |
|---|---|---|
| `OrderID` | `string` | Your order ID |
| `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` | `map[string]any` | The gateway's response, for logging |

## FormPayment

Returned by `AyaPay()` → `Initiate()` and `CyberSource()` → `HostedCheckout()`.

| Field / Method | Type | Description |
|---|---|---|
| `OrderID` | `string` | Your order ID |
| `Action` | `string` | The gateway URL the form posts to |
| `Fields` | `[]FormField` | The signed hidden fields (`Name`, `Value`), in signing order. Post them unchanged |
| `Enctype` | `string` | The form encoding the gateway expects. `HTML()` treats an empty value as `application/x-www-form-urlencoded` |
| `Field(name)` | `(string, bool)` | The value of one field |
| `Values()` | `map[string]string` | The fields as a map |
| `HTML()` | `string` | A full HTML page that posts the form on load |
| `HTMLWithNonce(nonce)` | `string` | `HTML()` with `nonce` on its inline script, for a Content-Security-Policy |

## QrPayment

Returned by `KbzPay()` → `QR()`, `YomaMmqr()` → `Initiate()` and `YomaMmqr()` → `RenewQR()`.

| Field / Method | Type | Description |
|---|---|---|
| `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` | `time.Time` | When the QR stops being payable. Zero when the gateway does not limit it |
| `Reference` | `string` | The gateway's ID for this QR (KBZ `prepay_id`, Yoma `refLabel`) |
| `Raw` | `map[string]any` | The gateway's response, for logging |
| `QRImageDataURI(mimeType)` | `string` | `QRImage` as a data URI for `<img src>`. An empty `mimeType` means `image/png` |

## AppPayment

Returned by `KbzPay()` → `App()`.

| Field | 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` | `map[string]any` | The gateway's response, for logging |

Encoded as JSON, an `AppPayment` has `orderId`, `orderInfo`, `sign` and `signType` for your mobile app; `Raw` is left out.

## MiniAppPayment

Returned by `WavePayMiniApp()` → `Payment()`. No request is sent: send `JSON()` to your mini app page, which hands it unchanged to `WaveJsSDK.paymentModule.makePayment()`.

| Field / 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` | `[]MiniAppItem` | The line items, each with a `Name` and an `Amount` |
| `JSON()` | `string` | Exactly the `makePayment` object, in this key order: `amount`, `miniAppID`, `merchantRefID`, `orderID`, `callBackUrl`, `hashValue`, `items` (`name`, `amount`). Amounts are JSON integers with every digit |
| `MarshalJSON()` | `([]byte, error)` | `JSON()`. `encoding/json` (and so `ctx.Response().Json()`) escapes `<`, `>` and `&` in it; send `JSON()` with `ctx.Response().Data()` to keep the exact text |

## PaymentFlow

| Constant | Value | Result |
|---|---|---|
| `myanmarpayments.FlowRedirect` | `redirect` | `RedirectPayment` |
| `myanmarpayments.FlowForm` | `form` | `FormPayment` |
| `myanmarpayments.FlowQR` | `qr` | `QrPayment` |
| `myanmarpayments.FlowApp` | `app` | `AppPayment` |
| `myanmarpayments.FlowMiniApp` | `mini_app` | `MiniAppPayment` |
