Skip to content

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().

FieldTypeDescription
OrderIDstringYour order ID
URLstringThe gateway page to redirect the customer to
GatewayReferencestringThe gateway's ID for this attempt (KBZ prepay_id, Wave transaction_id)
Rawmap[string]anyThe gateway's response, for logging

FormPayment ​

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

Field / MethodTypeDescription
OrderIDstringYour order ID
ActionstringThe gateway URL the form posts to
Fields[]FormFieldThe signed hidden fields (Name, Value), in signing order. Post them unchanged
EnctypestringThe 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]stringThe fields as a map
HTML()stringA full HTML page that posts the form on load
HTMLWithNonce(nonce)stringHTML() with nonce on its inline script, for a Content-Security-Policy

QrPayment ​

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

Field / MethodTypeDescription
OrderIDstringYour order ID
QRStringstringA QR payload to encode yourself (KBZ Pay)
QRImagestringA base64 image to display as is (Yoma MMQR)
ExpiresAttime.TimeWhen the QR stops being payable. Zero when the gateway does not limit it
ReferencestringThe gateway's ID for this QR (KBZ prepay_id, Yoma refLabel)
Rawmap[string]anyThe gateway's response, for logging
QRImageDataURI(mimeType)stringQRImage as a data URI for <img src>. An empty mimeType means image/png

AppPayment ​

Returned by KbzPay() → App().

FieldTypeDescription
OrderIDstringYour order ID
OrderInfostringThe signed order string the SDK expects
SignstringThe signature of OrderInfo
SignTypestringSHA256
Rawmap[string]anyThe 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 / MethodTypeDescription
OrderIDstringYour order ID (orderID)
AmountAmountThe signed total, in whole kyat
MiniAppIDstringThe configured mini app ID (miniAppID)
MerchantReferenceIDstringYour ID for this attempt (merchantRefID)
CallbackURLstringThe signed callback URL (callBackUrl)
HashValuestringThe payload's hash (hashValue)
Items[]MiniAppItemThe line items, each with a Name and an Amount
JSON()stringExactly 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 ​

ConstantValueResult
myanmarpayments.FlowRedirectredirectRedirectPayment
myanmarpayments.FlowFormformFormPayment
myanmarpayments.FlowQRqrQrPayment
myanmarpayments.FlowAppappAppPayment
myanmarpayments.FlowMiniAppmini_appMiniAppPayment