从Stripe Webhook更新Parse.com用户 [英] Update Parse.com User from Stripe Webhook

查看:99
本文介绍了从Stripe Webhook更新Parse.com用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我看到这里有几个Parse / Stripe问题,但没有一个对我有任何帮助。

Firstly I see there are several Parse / Stripe questions on here however none are of any help to me.

我有一个免费和付费的移动应用程序特征。变量存储在Parse.com中的 User 类中,并在运行函数时检查其权限。我想设置一个帐户门户(与我的应用程序分开),因此当用户希望注册时,他们会被发送到他们的浏览器,并可以通过SSL等注册计划。

I have a mobile application that has both free and paid features. A variable is stored on the User class in Parse.com and it is checked for permissions when running a function. I would like to setup an account portal (separate to my app) so when users wish to signup they are sent to their browser and can signup to a plan over SSL etc etc.

对于帐户门户网站,我有一个带有Stripe插件的Wordpress网站,可以为我的会计,发票和表单创建工作。

For the account portal i'm having a Wordpress site with a Stripe plugin that will do my accounting, invoicing and form creation work for me.

注册后Wordpress网站我想在Parse.com上收到webhook并运行一个函数来更新 User 类。理想情况下,这将是一个捕获所有功能,将根据用户的帐户状态将用户更改为多个州(即他们停止付款并且计划将被暂停)。

Following signup on the Wordpress site I would like to receive the webhook on Parse.com and run a function to update User class. Ideally this will be a catch all function that will change the user to a number of states depending on their account status (i.e they stop paying and the plan will be on hold).

我的问题有两个:


  1. 我需要在Stripe webhook设置中添加哪些详细信息(URL等)将所有事件发送到我的Parse.com云代码?

  1. What details (URL etc) do I need to place in my Stripe webhook settings to send all events to my Parse.com cloud code?

如何在收到来自Parse.com的webhook后收到/运行我的云代码功能?

How do I receive / run my function on the Cloud code upon receipt of a webhook from Parse.com?

如果您对我的应用程序应该如何运作有任何建议,我会受到批评并在我的实施中保持灵活性。

I am open to criticism and remain flexible in my implementation if you have suggestions on how my app should work.

非常感谢提前。

推荐答案

经过一些实验后确定:


  1. 使用URL在Stripe Accounts区域中创建一个webhook:
    https:// ** APPLICATION_ID **:javascript-key = ** JAVASCRIPT_KEY ** @ api。 parse.com/1/functions/update_user

在您的云代码中使用与URL最后部分相同的函数名称。在我的情况下 update_user

In your cloud code use the same function name as the final part of your URL. in my case update_user.

创建webhook的测试版并将其放入您的云代码中用于测试:

Create a test version of the webhook and place this in your cloud code for testing :

Parse.Cloud.define(update_user,function(request,响应){
response.success('** WEBHOOK WORKING **'+ request);
});

在条带仪表板中运行测试时,您应该看到:

When running the test in the stripe dashboard you should see:

希望这对某人有所帮助 - 会感激任何人对我的实现或光滑功能的任何输入用户课程更新。

Hope that this helps someone - Would be grateful of any input anyone has as to my implementation or a slick function to run on my User class update.

这篇关于从Stripe Webhook更新Parse.com用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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