跳至主要内容

欺诈已报告 Webhook

当支付处理商报告已完成付款存在欺诈时,Aghanim 会发送 fraud.reported webhook 来通知你的游戏。 此事件会在原始扣款后的数天或数周后到达,此时卡组织或发卡行会追溯性地将一笔付款标记为欺诈。

此 Webhook 是通过 欺诈已报告 事件激活的,可在 游戏 → Webhooks 中选择。

要求

要使用 Aghanim 的欺诈已报告 Webhook,请按照以下要求配置您的 Webhook 服务器:

  • HTTPS 端点,可接收 POST Webhook 请求。
  • 监听由 Aghanim 生成并签名的事件。
  • 处理 Webhook 负载中包含的 idempotency_key,以防止重复处理 Webhook。
  • 如果已成功处理欺诈事件,则响应 2xx 状态码;如有拒绝或错误,则用 4xx 或 5xx 状态码。

配置步骤

  1. 为 fraud.reported Webhook 处理开发一个函数。
  2. 部署您的端点使其可访问。
  3. 登录您的 Aghanim 账户,导航至 Game → Webhooks → New Webhook,选择 Fraud reported 事件类型完成注册。

或者,您也可以使用 Create Webhook API 方法在 Aghanim 中注册您的端点。

Request schema

下面是一个 fraud.reported Webhook 请求示例:

POST /your/webhook/uri HTTP/1.1
Content-Type: application/json
Host: your-webhook-endpoint.com
User-Agent: Aghanim/0.1.0
X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812
X-Aghanim-Signature-Timestamp: 1725548450

{
"event_type": "fraud.reported",
"event_data": {
"id": "frd_aBcDeFgHiJkLmNoPqRs",
"player_id": "2D2R-OP3C",
"order_id": "ord_eCacpFwavzi",
"payment_id": "pmt_eFgYpxryeKXpLKfmZstI",
"fraud_type": "card_stolen",
"amount": 9499,
"currency": "USD",
"payment_method": "cards",
"reported_at": 1725547595
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": "idmpt_aXRlb...JkX2VFS",
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": null,
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}

事件 Schema

键名类型描述
event_idstring阿哈利姆生成的唯一事件标识符。
game_idstring您的游戏在阿哈利姆中的唯一标识符。
event_typestring事件的类型, fraud.reported 在此情境下。
event_timenumberThe time the event was sent, in Unix epoch time. May differ across duplicate deliveries of the same event.
event_dataEventData包含事件特定数据的字段,其中可能包含用于继承对象的各种键值。
idempotency_keystring即使出现重试情况,也能确保 Webhook 操作只执行一次。
request_idstring|null如果事件是通过 API 请求触发的,此字段将包含对应的请求 ID。
sandboxboolean标识事件是否来自沙盒测试环境的指示器。
triggerstring|null触发该事件发送的触发器。
transaction_idstring阿哈利姆生成的交易标识符。在同一交易过程中触发的多个事件可能共享相同的交易 ID。
contextobject|null事件的相关上下文信息。

EventData Schema

字段名Type描述
idstring欺诈报告的唯一标识符
player_idstring发起支付的玩家
order_idstring与支付关联的订单
payment_idstring被标记的支付
fraud_typeenum标准化欺诈类别(card_lost、card_stolen、unauthorized_card_use、counterfeit_card、fraudulent_application、other)
amountnumber按 小额货币单位 计算的支付金额。
currencystring支付 货币。
payment_methodstring使用的支付方式(cards、apple_pay、google_pay 等)。
reported_atinteger支付处理方报告欺诈的 Unix 时间戳

推荐处理方式

  1. 考虑主动退款:欺诈报告会在正式拒付之前到达。 通过 Refund API 主动退款可以避免拒付费用。
  2. 标记玩家:按玩家跟踪欺诈报告。 同一玩家出现多次 fraud.reported 事件可能表明账户被入侵或被滥用。
  3. 退款时撤销物品:如果您退款,也请通过 Item Remove 撤销已发放的物品。

需要技术支持?
联系我们的集成技术团队: integration@aghanim.com