[{"data":1,"prerenderedAt":305},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fpayment":3,"docs-nav":261,"docs-order":293},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"body":10,"_type":255,"_id":256,"_source":257,"_file":258,"_stem":259,"_extension":260},"\u002Fdocs\u002Fpayment","docs",false,"","Payment","Submits the customer's chosen channel for a session. This is normally called by\nthe hosted Syok2Pay checkout, not directly by merchants — it is documented here\nfor completeness.",{"type":11,"children":12,"toc":251},"root",[13,22,27,33,37,44,49,55,84,148,161,245],{"type":14,"tag":15,"props":16,"children":18},"element","h1",{"id":17},"submit-a-payment",[19],{"type":20,"value":21},"text","Submit a payment",{"type":14,"tag":23,"props":24,"children":25},"p",{},[26],{"type":20,"value":9},{"type":14,"tag":28,"props":29,"children":32},"endpoint-meta",{"method":30,"path":31},"POST","\u002Fv1\u002Fpayment",[],{"type":14,"tag":34,"props":35,"children":36},"env-toggle",{},[],{"type":14,"tag":38,"props":39,"children":41},"h2",{"id":40},"request-body",[42],{"type":20,"value":43},"Request body",{"type":14,"tag":45,"props":46,"children":48},"param-table",{":rows":47},"[{\"name\":\"merchant_code\",\"type\":\"string\",\"required\":true,\"desc\":\"Your merchant code\"},{\"name\":\"reference_no\",\"type\":\"string\",\"required\":true,\"desc\":\"Order reference from initiate\"},{\"name\":\"amount\",\"type\":\"string\",\"required\":true,\"desc\":\"Decimal string, 2 dp\"},{\"name\":\"currency\",\"type\":\"string\",\"required\":true,\"desc\":\"ISO code, e.g. MYR\"},{\"name\":\"session_id\",\"type\":\"string\",\"required\":true,\"desc\":\"From initiate (cs_…)\"},{\"name\":\"payment_channel\",\"type\":\"string\",\"required\":true,\"desc\":\"e.g. FPX, TNG, GRABPAY\"},{\"name\":\"bank_code\",\"type\":\"string\",\"required\":false,\"desc\":\"For FPX, e.g. MBB\"},{\"name\":\"host_frontend_callback_url\",\"type\":\"string\",\"required\":true,\"desc\":\"Customer redirect target\"},{\"name\":\"host_backend_callback_url\",\"type\":\"string\",\"required\":true,\"desc\":\"Server-to-server callback\"}]",[],{"type":14,"tag":38,"props":50,"children":52},{"id":51},"response",[53],{"type":20,"value":54},"Response",{"type":14,"tag":23,"props":56,"children":57},{},[58,60,66,68,73,75,82],{"type":20,"value":59},"This endpoint does ",{"type":14,"tag":61,"props":62,"children":63},"strong",{},[64],{"type":20,"value":65},"not",{"type":20,"value":67}," return a JSON body on success. The gateway responds\nwith an HTTP ",{"type":14,"tag":61,"props":69,"children":70},{},[71],{"type":20,"value":72},"302 redirect",{"type":20,"value":74}," whose ",{"type":14,"tag":76,"props":77,"children":79},"code",{"className":78},[],[80],{"type":20,"value":81},"Location",{"type":20,"value":83}," header points to the selected\nbank or payment provider — the customer's browser follows it to complete payment.",{"type":14,"tag":85,"props":86,"children":90},"pre",{"className":87,"code":88,"language":89,"meta":7,"style":7},"language-http shiki shiki-themes github-dark","HTTP\u002F1.1 302 Found\nLocation: https:\u002F\u002Fbank.example\u002Ffpx\u002Fredirect?token=...\n","http",[91],{"type":14,"tag":76,"props":92,"children":93},{"__ignoreMap":7},[94,129],{"type":14,"tag":95,"props":96,"children":99},"span",{"class":97,"line":98},"line",1,[100,106,112,118,123],{"type":14,"tag":95,"props":101,"children":103},{"style":102},"--shiki-default:#F97583",[104],{"type":20,"value":105},"HTTP",{"type":14,"tag":95,"props":107,"children":109},{"style":108},"--shiki-default:#E1E4E8",[110],{"type":20,"value":111},"\u002F",{"type":14,"tag":95,"props":113,"children":115},{"style":114},"--shiki-default:#79B8FF",[116],{"type":20,"value":117},"1.1",{"type":14,"tag":95,"props":119,"children":120},{"style":114},[121],{"type":20,"value":122}," 302",{"type":14,"tag":95,"props":124,"children":126},{"style":125},"--shiki-default:#9ECBFF",[127],{"type":20,"value":128}," Found\n",{"type":14,"tag":95,"props":130,"children":132},{"class":97,"line":131},2,[133,138,143],{"type":14,"tag":95,"props":134,"children":136},{"style":135},"--shiki-default:#85E89D",[137],{"type":20,"value":81},{"type":14,"tag":95,"props":139,"children":140},{"style":102},[141],{"type":20,"value":142},":",{"type":14,"tag":95,"props":144,"children":145},{"style":125},[146],{"type":20,"value":147}," https:\u002F\u002Fbank.example\u002Ffpx\u002Fredirect?token=...\n",{"type":14,"tag":23,"props":149,"children":150},{},[151,153,159],{"type":20,"value":152},"On failure, the gateway either redirects back to the hosted pay page with an\n",{"type":14,"tag":76,"props":154,"children":156},{"className":155},[],[157],{"type":20,"value":158},"error",{"type":20,"value":160}," query parameter, or (for direct\u002FJSON callers) returns a JSON error:",{"type":14,"tag":85,"props":162,"children":166},{"className":163,"code":164,"language":165,"meta":7,"style":7},"language-json shiki shiki-themes github-dark","{ \"success\": false, \"error\": { \"code\": \"PAYMENT_FAILED\", \"message\": \"...\" } }\n","json",[167],{"type":14,"tag":76,"props":168,"children":169},{"__ignoreMap":7},[170],{"type":14,"tag":95,"props":171,"children":172},{"class":97,"line":98},[173,178,183,188,193,198,203,208,213,217,222,226,231,235,240],{"type":14,"tag":95,"props":174,"children":175},{"style":108},[176],{"type":20,"value":177},"{ ",{"type":14,"tag":95,"props":179,"children":180},{"style":114},[181],{"type":20,"value":182},"\"success\"",{"type":14,"tag":95,"props":184,"children":185},{"style":108},[186],{"type":20,"value":187},": ",{"type":14,"tag":95,"props":189,"children":190},{"style":114},[191],{"type":20,"value":192},"false",{"type":14,"tag":95,"props":194,"children":195},{"style":108},[196],{"type":20,"value":197},", ",{"type":14,"tag":95,"props":199,"children":200},{"style":114},[201],{"type":20,"value":202},"\"error\"",{"type":14,"tag":95,"props":204,"children":205},{"style":108},[206],{"type":20,"value":207},": { ",{"type":14,"tag":95,"props":209,"children":210},{"style":114},[211],{"type":20,"value":212},"\"code\"",{"type":14,"tag":95,"props":214,"children":215},{"style":108},[216],{"type":20,"value":187},{"type":14,"tag":95,"props":218,"children":219},{"style":125},[220],{"type":20,"value":221},"\"PAYMENT_FAILED\"",{"type":14,"tag":95,"props":223,"children":224},{"style":108},[225],{"type":20,"value":197},{"type":14,"tag":95,"props":227,"children":228},{"style":114},[229],{"type":20,"value":230},"\"message\"",{"type":14,"tag":95,"props":232,"children":233},{"style":108},[234],{"type":20,"value":187},{"type":14,"tag":95,"props":236,"children":237},{"style":125},[238],{"type":20,"value":239},"\"...\"",{"type":14,"tag":95,"props":241,"children":242},{"style":108},[243],{"type":20,"value":244}," } }\n",{"type":14,"tag":246,"props":247,"children":248},"style",{},[249],{"type":20,"value":250},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":131,"depth":131,"links":252},[253,254],{"id":40,"depth":131,"text":43},{"id":51,"depth":131,"text":54},"markdown","content:docs:4.payment.md","content","docs\u002F4.payment.md","docs\u002F4.payment","md",[262,265,268,271,274,277,280,281,284,287,290],{"_path":263,"title":264},"\u002Fdocs\u002Fauthentication","Authentication",{"_path":266,"title":267},"\u002Fdocs\u002Fcallbacks","Callbacks",{"_path":269,"title":270},"\u002Fdocs\u002Fget-session","Get Session",{"_path":272,"title":273},"\u002Fdocs\u002Fgetting-started","Getting started",{"_path":275,"title":276},"\u002Fdocs\u002Finitiate","Initiate",{"_path":278,"title":279},"\u002Fdocs\u002Finquiry","Inquiry",{"_path":4,"title":8},{"_path":282,"title":283},"\u002Fdocs\u002Frefund","Refund",{"_path":285,"title":286},"\u002Fdocs\u002Fstatus-codes","Status codes",{"_path":288,"title":289},"\u002Fdocs\u002Fvoid","Void",{"_path":291,"title":292},"\u002Fdocs\u002Fwoocommerce","WooCommerce",[294,295,296,297,298,299,300,301,302,303,304],{"_path":272,"title":273},{"_path":263,"title":264},{"_path":275,"title":276},{"_path":4,"title":8},{"_path":269,"title":270},{"_path":278,"title":279},{"_path":282,"title":283},{"_path":288,"title":289},{"_path":266,"title":267},{"_path":285,"title":286},{"_path":291,"title":292},1787651215633]