safePayGuardJs
About 148 wordsLess than 1 minute
2025-03-07
SafePayGuardJs is a risk control plugin for the payment process, including fraud prevention, fund security protection, and enhanced user experience.
Installation
<script src="https://pay-cdn.pingpongx.com/production-fra/static/safe-pay-guard/safePayGuard.min.js"></script>Initialization
Define Initialization Parameters
Caution
For sandbox testing, set env=SANDBOX. For production environment, set env=PRODUCTION.
const options = {
env: 'DEV', // 'SANDBOX'|'PRODUCTION'
accId: accId,
clientId: clientId,
requestId: requestId,
merchantUserId: merchantUserId,
}Initialize
SafePayGuardJs.init(options)Get generatedData
After initialization is complete, the plugin will automatically collect device fingerprints and risk control parameters. Before actually initiating the payment request, you only need to call the plugin's getGeneratedData method to obtain them (hereinafter referred to as generatedData), and pass them in the subsequent payment.
Example:
const generatedData = SafePayGuardJs.getGeneratedData()
// generatedData:
{
fingerPrint: string;
forterSiteId: string;
forterTokenCookie: string | null;
riskExtendInfos: [{
channelCode: "1xxxxx0x",
metadata: "xxx5xxxd5dxxxxxeaxxxxxxxdxfxx"
}]
}