Overview
Oceanpayment uses a server-to-server (S2S) asynchronous notification (Webhook) mechanism to proactively push payment results to the merchant's specified endpoint.
Webhook
A webhook provides a reliable, real-time way to update order status. Merchants must properly receive and handle these notifications to ensure the final consistency of order statuses.
const express = require('express');
const bodyParser = require('body-parser');
const xml2js = require('xml2js');
const app = express();
const PORT = 8080;
app.use(bodyParser.text({
type:'application/xml'
}));
app.post('/payment/notify', async(req, res) => {
const xml = req.body;
});
Notification Types
Oceanpayment supports multiple types of webhook notifications to meet different business scenarios:
📢
🧾
🛃