小编Mar*_*iel的帖子

将 Stripe webhooks 与 graphql-yoga 和 Prisma 结合使用

我在寻找如何拦截应用程序中的 Stripe webhook 调用时遇到了一些困难。我使用 graphql-yoga (express) 和 prisma。

我必须监听来自 Stripe 的付款失败呼叫,以便我可以编辑相应的用户配置文件。

谢谢您的帮助!

Stripe webhook 调用如下所示:

{
  "created": 1326853478,
  "id": "charge.expired_00000000000000",
  "type": "charge.expired",
  "object": "event",
  "request": null,
  "pending_webhooks": 1,
  "data": {
    "object": {
      "id": "ch_00000000000000",
      "object": "charge",
      "amount": 100,
      "captured": false,
      "created": 1537153592,
      "currency": "usd",
      "customer": null,
      "description": "My First Test Charge (created for API docs)",
      "invoice": null,
      "livemode": false,
      "on_behalf_of": null,
      "order": null,
      "outcome": null,
      "paid": true,
      "receipt_email": null,
      "receipt_number": null,
      "refunded": false,
      "review": null,
      "shipping": null,
      "source": {
        "id": …
Run Code Online (Sandbox Code Playgroud)

webhooks express stripe-payments graphql prisma

2
推荐指数
1
解决办法
1727
查看次数

标签 统计

express ×1

graphql ×1

prisma ×1

stripe-payments ×1

webhooks ×1