Skip to content

Results ​

Starting a payment returns one of four final classes in Laranex\PhpMyanmarPayments\Results, with read-only properties. Each implements PaymentResult, whose flow() returns a PaymentFlow, so a match or instanceof check tells them apart. Properties a gateway did not provide are null.

RedirectPayment ​

Returned by $kbz->pwa() and $wave->initiate().

Property / MethodTypeDescription
flow()PaymentFlowPaymentFlow::Redirect
orderIdstringYour order ID, as sent to the gateway
urlstringThe gateway page to redirect the customer to
gatewayReference?stringThe gateway's ID for this attempt (KBZ prepay_id, Wave transaction_id)
rawarrayThe gateway's response, for logging

FormPayment ​

Returned by $aya->initiate() and $cs->initiate().

Property / MethodTypeDescription
flow()PaymentFlowPaymentFlow::Form
orderIdstringYour order ID
actionstringThe gateway URL the form posts to
fieldsarray<string, string>The signed hidden fields, name => value, in order. Post them unchanged
enctypestringThe encoding the gateway expects; application/x-www-form-urlencoded unless the gateway needs another (AYA: multipart/form-data)
toHtml()stringA complete, escaped page that submits the form on load
field($name)?stringOne field's value
values()array<string, string>The fields as an array
autoSubmitUrl?stringLink to a page that renders the form. null unless set with withAutoSubmitUrl()
withAutoSubmitUrl($url)FormPaymentA copy with autoSubmitUrl set

QrPayment ​

Returned by $kbz->qr(), $yoma->initiate() and $yoma->renewQr().

Property / MethodTypeDescription
flow()PaymentFlowPaymentFlow::Qr
orderIdstringYour order ID
qrString?stringA QR payload to encode yourself (KBZ Pay)
qrImage?stringA base64 image to display as is (Yoma MMQR)
expiresAt?DateTimeImmutableWhen the QR stops being payable; null when the gateway sets no limit
reference?stringThe gateway's ID for this QR, used for status checks (Yoma refLabel, KBZ prepay_id)
rawarrayThe gateway's response, for logging
qrImageDataUri($mimeType = 'image/png')?stringqrImage as a data URI. null when there is no image

AppPayment ​

Returned by $kbz->app(). $payment->toArray() returns orderId, orderInfo, sign and signType, the names the KBZ Pay SDK uses.

Property / MethodTypeDescription
flow()PaymentFlowPaymentFlow::App
orderIdstringYour order ID
orderInfostringThe signed order string the SDK expects
signstringThe signature of orderInfo
signTypestringThe signature algorithm, SHA256
rawarrayThe gateway's response; left out of toArray()
toArray()array<string, string>['orderId', 'orderInfo', 'sign', 'signType'], the values your app needs

PaymentFlow ​

A string-backed enum in Laranex\PhpMyanmarPayments\Enums, so $payment->flow()->value is redirect, form, qr or app.

CaseValueClass
PaymentFlow::RedirectredirectRedirectPayment
PaymentFlow::FormformFormPayment
PaymentFlow::QrqrQrPayment
PaymentFlow::AppappAppPayment

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://…').

Released under the MIT License, except where a package says otherwise.