Firebase云功能-Stripe Connect Webhook无法触发 [英] Firebase Cloud Functions - Stripe Connect Webhook not firing

查看:88
本文介绍了Firebase云功能-Stripe Connect Webhook无法触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置条带化Web钩子,以在此时创建,更新Stripe Connect帐户或进行任何其他操作时自动触发Firebase云功能.仅当我手动转到Stripe Dashboard> Webhooks并单击发送测试Webhook按钮"时,才会触发.

I'm trying to set up my stripe webhooks to fire invoking a firebase cloud function automatically whenever a Stripe Connect account is created, updated, or anything at this point. It only fires if I manually go to the Stripe Dashboard > Webhooks and hit the "send test webhook button".

到目前为止我所做的:

1)创建了一个Stripe Connect Webhook:

1) created a Stripe Connect Webhook:

2)使用Firebase URL设置Webhook端点

2) set up Webhook endpoint with firebase URL

3)设置node.js Firebase Cloud函数,以在条带的Webhook ping Firebase URL时触发.

3) set up node.js Firebase Cloud function to fire whenever stripe's webhook pings the Firebase URL.

const admin = require('firebase-admin');
const functions = require('firebase-functions');
admin.initializeApp(functions.config().firebase);
const stripeToken = require('stripe')(functions.config().stripe.token);
const stripeWebhooks = require('stripe')(functions.config().keys.webhooks);
const express = require('express');
const cors = require('cors');
const endpointSecret = functions.config().keys.signing;
const request = require('request-promise');
const app = express();

// Automatically allow cross-origin requests
app.use(cors({ origin: true }));

exports.stripeCreateOathResponseToken = functions.https.onRequest(cors((req, res) => {

    res.send("cloud function fired");

}));

我缺少什么让Stripe Webhook无法自动启动?

What am I missing that doesnt let the Stripe Webhook fire automatically?

这是我一直关注的一些教程:

here are some of the tutorials I've been following:

https://medium.com/@koss_lebedev/stripe-webhooks-in-connect-applications-a7d71bdd44e1

https://github.com/GaryH21/Stripe-Webhooks-Tutorial/blob/master/functions/index.js

https://medium.com/@ GaryHarrower/working-with-stripe-webhooks-firebase-cloud-functions-5366c206c6c

推荐答案

您已将其设置为连接端点.您需要确保事件实际上是在关联帐户(而不是您自己的平台帐户)上发生的,因为您自己帐户的事件不会发送到Connect Endpoint.

You have set this up as a Connect Endpoint. You'll need to make sure the events are actually occurring on connected accounts (and not your own platform account), as your own account's events won't get sent to a Connect Endpoint.

您可以通过创建关联的帐户并从中验证事件来进行测试得到发送.

You can test this by creating a connected account and verifying that events from it get sent.

这篇关于Firebase云功能-Stripe Connect Webhook无法触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆