Javascript 环回和条纹网钩
我目前有一个环回项目设置,我正在尝试从stripe接收webhooks 我当前的远程方法如下所示:-Javascript 环回和条纹网钩,javascript,api,stripe-payments,loopbackjs,strongloop,Javascript,Api,Stripe Payments,Loopbackjs,Strongloop,我目前有一个环回项目设置,我正在尝试从stripe接收webhooks 我当前的远程方法如下所示:- Stripeconnect.stripeWebhook = function(msg, cb) { cb(null, msg); }; Stripeconnect.remoteMethod( 'stripeWebhook', { description: 'This will insert the description', http: { path: '/
Stripeconnect.stripeWebhook = function(msg, cb) {
cb(null, msg);
};
Stripeconnect.remoteMethod(
'stripeWebhook', {
description: 'This will insert the description',
http: {
path: '/stripeWebhook',
verb: 'get'
},
accepts:
{arg: 'msg', type: 'any'},
returns: {
arg: 'status',
type: 'any'
}
}
)
但我从Stripe收到的回复是:-
undefined [Function: callback]
我无法在网上找到任何关于环回和条带Webhook的文档
有谁能帮我,或者给我指出正确的方向吗
我已经设置了指向API端点的条带
提前谢谢。如果您需要更多信息,请让我知道。好的,因此我可以通过获得身体的响应来实现这一点:-
/**
* Receiving Webhook
* @desc Webhook EP
* @param {data} Object from Stripe.
* @return {response} response code
*/
Stripeconnect.stripeWebhook = function(request, cb) {
console.log(request.type, request.data);
};
Stripeconnect.remoteMethod(
'stripeWebhook', {
accepts: { arg: 'data', type: 'object', http: { source: 'body' } },
returns: [
{arg: 'response', type: 'any', root: true }
]
});
您可以从以下位置看到:-
accepts: { arg: 'data', type: 'object', http: { source: 'body' } },
希望这有助于任何其他人谁是有这个或类似的问题