Skip to main content

Hosted Checkout

Three endpoints exist for the checkout page you show the payer. That page holds no merchant private key, so these calls are unsigned and unencrypted; the SDK still exposes them so a backend can call them for reconciliation or to complete an order on the payer's behalf.

PurposeGoJavaScriptPythonPHPJava
Read checkout stateGetPaymentCheckout(orderNo)getPaymentCheckout(orderNo)get_payment_checkout(order_no)getPaymentCheckout($orderNo)getPaymentCheckout(orderNo)
Payer reports the transfer reference (UTR)SubmitPaymentTradeNo(orderNo, tradeNo)submitPaymentTradeNo(orderNo, tradeNo)submit_payment_trade_no(order_no, trade_no)submitPaymentTradeNo($orderNo, $tradeNo)submitPaymentTradeNo(orderNo, tradeNo)
Payer supplies details for a create-first orderAddPaymentExtraInfo(orderNo, payMethod, extra)addPaymentExtraInfo(orderNo, payMethod, extra)add_payment_extra_info(order_no, pay_method, extra)addPaymentExtraInfo($orderNo, $payMethod, $extra)addPaymentExtraInfo(orderNo, payMethod, extra)

status is the outcome, not the HTTP code​

The two POST calls answer HTTP 200 with envelope code 200 even when the platform refuses the request. The outcome is in the returned object:

statusMeaning
1Accepted
0Refused; message says why (invalid state, rate limited, ...)

A caller that only checks for a thrown error reads a refusal as success. Always check status.

res, err := c.SubmitPaymentTradeNo(ctx, orderNo, utr)
if err != nil { /* transport or envelope problem */ }
if !res.Ok() { // Status != 1
show(res.Message)
}

Go returns typed SubmitTradeNoResult and AddExtraInfoResult with an Ok() helper.

Create first, fill in later​

Some methods let you create the order without payer details and collect them on your own page. addPaymentExtraInfo sends those details and triggers the real upstream order; the response then carries paymentUrl, the page to redirect the payer to. payMethod and extra are optional; omitted fields are not sent.

Checkout state​

getPaymentCheckout returns the order as the checkout page sees it: orderNo, status, orderStatus, amount, currency, payMethod, returnUrl, and params with payContent (the QR or transfer content to render) and reusable (whether the content may stay visible after a successful payment). Note that orderStatus uses the checkout vocabulary (CREATED, PENDING, ...), which differs from the merchant API status strings.

Opening the checkout or returning to your site does not confirm payment. Confirm with the webhook or an order query.