Skip to content

Results ​

Starting a payment returns a pointer to one of four structs from the root package myanmarpayments. Each implements PaymentResult, whose Flow() method returns a PaymentFlow, so a type switch or Flow() tells them apart. Fields a gateway did not provide are "".

RedirectPayment ​

Returned by kbz.PWA() and wave.Initiate().

Field / MethodTypeDescription
Flow()PaymentFlowFlowRedirect
OrderIDstringYour order ID, as sent to the gateway
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 aya.Initiate() and cs.Initiate().

Field / MethodTypeDescription
Flow()PaymentFlowFlowForm
OrderIDstringYour order ID
ActionstringThe gateway URL the form posts to
Fields[]FormFieldThe signed hidden fields in order. Post them unchanged
EnctypestringThe encoding the gateway expects: multipart/form-data (AYA) or application/x-www-form-urlencoded (CyberSource)
HTML()stringA complete page that submits the form on load. Every value is HTML-escaped (" as ", ' as '), so the page is byte-for-byte the same in every Laranex SDK
Field(name)(string, bool)One field's value
Values()map[string]stringThe fields as a map

FormField is a struct with Name string and Value string.

QrPayment ​

Returned by kbz.QR(), yoma.Initiate() and yoma.RenewQR().

Field / MethodTypeDescription
Flow()PaymentFlowFlowQR
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; the zero time when the gateway sets no limit
ReferencestringThe gateway's ID for this QR, used for status checks (Yoma refLabel, KBZ prepay_id)
Rawmap[string]anyThe gateway's response, for logging
QRImageDataURI(mimeType)stringQRImage as a data URI; "" as mimeType means image/png. "" when there is no image

AppPayment ​

Returned by kbz.App(). It encodes to JSON as orderId, orderInfo, sign and signType, the names the KBZ Pay SDK uses.

Field / MethodTypeDescription
Flow()PaymentFlowFlowApp
OrderIDstringYour order ID
OrderInfostringThe signed order string the SDK expects
SignstringThe signature of OrderInfo
SignTypestringThe signature algorithm, SHA256
Rawmap[string]anyThe gateway's response; left out of the JSON encoding

PaymentFlow ​

A string type, so payment.Flow() == "redirect" works too.

ConstantValueType
FlowRedirectredirectRedirectPayment
FlowFormformFormPayment
FlowQRqrQrPayment
FlowAppappAppPayment

Raw values are decoded JSON: numbers are json.Number, never a float64. Use json.Marshal(payment.Raw) to log them.

Every result type is a plain struct, so you can build one in your own tests, e.g. &myanmarpayments.RedirectPayment{OrderID: "ORDER_1", URL: "https://…"}.

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