Skip to content

Results ​

Starting a payment returns a pointer to one of four 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 WaveMoney() → 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() → Initiate().

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

payments.AutoSubmitURL(form) returns the link to the package's auto-submitting page; it returns payments.ErrFormRouteDisabled when the form route is disabled.

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.

PaymentFlow ​

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

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