我有以下 WebView 小部件/我正在尝试触发 StripeConnect 帐户创建的完成(或不完成),以关闭视图。我找不到任何关于什么应该是触发通道的文档。
child: WebView(
initialUrl:
stripeConnecturl,
javascriptMode: JavascriptMode.unrestricted,
javascriptChannels: [
JavascriptChannel(name: 'response', onMessageReceived: (s) {
print('everything is okay');
print(s.message);
Navigator.pop(context);
}),
].toSet(),
这是我的云功能
exports.connectStripeExpressAccount = functions.https.onRequest((req, res) =>{
console.log('query state is ----> ' + req.query.state);
const authCode = req.query.code;
return stripe.oauth.token({
grant_type: 'authorization_code',
code: authCode,
}).then(async response => {
var connected_account_id = response.stripe_user_id;
const uid = req.query.state
const writeResult = await admin.firestore().collection('Registration').doc(uid)
.set({'customer_id': connected_account_id});
return res.send("Well done, account integration is completed. You can now close the window and go back to the app");
});
});