Skip to content

Results ​

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

RedirectPayment ​

Returned by kbzPay().pwa() and waveMoney().initiate().

PropertyTypeDescription
orderIdstringYour order ID
urlstringThe gateway page to redirect the customer to
gatewayReferencestring | undefinedThe gateway's ID for this attempt (KBZ prepay_id, Wave transaction_id)
rawReadonly<Record<string, unknown>>The gateway's response, for logging

FormPayment ​

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

Property / MethodTypeDescription
orderIdstringYour order ID
actionstringThe gateway URL the form posts to
fieldsreadonly FormField[]The signed hidden fields (name, value), in signing order. Post them unchanged
enctypestringThe form encoding the gateway expects
field(name)string | undefinedThe value of one field
values()Record<string, string>The fields as an object, e.g. for your own template
toHtml()stringA full HTML page that posts the form on load

this.payments.autoSubmitUrl(payment) returns the link to the module's auto-submitting page. It throws when the form route is disabled.

QrPayment ​

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

Property / MethodTypeDescription
orderIdstringYour order ID
qrStringstring | undefinedA QR payload to encode yourself (KBZ Pay)
qrImagestring | undefinedA base64 image to display as is (Yoma MMQR)
expiresAtDate | undefinedWhen the QR stops being payable
referencestring | undefinedThe gateway's ID for this QR (KBZ prepay_id, Yoma refLabel)
rawReadonly<Record<string, unknown>>The gateway's response, for logging
qrImageDataUri(mimeType = 'image/png')string | undefinedqrImage as a data URI for <img src>

AppPayment ​

Returned by kbzPay().app().

Property / MethodTypeDescription
orderIdstringYour order ID
orderInfostringThe signed order string the SDK expects
signstringThe signature of orderInfo
signTypestringSHA256
rawReadonly<Record<string, unknown>>The gateway's response, for logging
toJSON()objectorderId, orderInfo, sign, signType for your mobile app

PaymentFlow ​

ValueStringResult
PaymentFlow.RedirectredirectRedirectPayment
PaymentFlow.FormformFormPayment
PaymentFlow.QrqrQrPayment
PaymentFlow.AppappAppPayment

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