I have an event handler on the StripeEvents table (the one used by the Stripe integration) and it doesn’t matter what event I bind it to it never fires. What event should I be attaching to in order to have my handler called whenever that table has new records from the Stripe integration plugin?
Hi, could you clarify, what type of handler do you use? (before/after, create/update/delete)
And the second question, what if to make api call (that type you bound the handler to), is it called?
So I’ve tried create, upsert and bulk upsert. The Stripe plug-in integration is populating the StripeEvents table and I am logging to the console in the handler (just to test the event) but they never show. If I do a post to the table via the rest interface then the handler gets called but it seems when data is inserted directly by your stripe integration the handlers do not get called.
Simon
I’ll try to ask our team which worked on the plugin.
Could you, please, try with the beforeCreate handler?
Hi @Simon_Lee
The Stripe API Service creates records in the StripeEvents and you can not catch it in an EventHandler because when you work with Data API inside CloudCode it doesn’t run any event handlers to avoid issues with circular calls. For instance:
- create a new object in a table A
- it runs a before-create event handler for table A
- inside the event handler it calls an API Service
- inside the API Service you want to create a new object in the table A
- as a result we’ve got an infinitive loop
Could you please describe you main goal and we try to find out an alternative solution
Regards,
Vlad
Hi Vlad, thanks. So I’m using the Stripe plug-in but need to purchase subscriptions so can’t just use the Charge endpoint. Instead I am using payment links and was hoping to catch the incoming hook and then update the user record to say whether there is an active subscription or not.
Thanks again.
Simon
ok, what about having a Timer which runs each minute and checks the StripeEvents table for new records?
No that won’t work sadly. I’ve decided to write my own handler however I follow this outdated guide (https://backendless.com/docs/bl-js/bl_basic_quick_start_guide_js.html) but when I upload and deploy the service never appears in the Services list. Should this still work?
Simon
could you please share a screenshot of your files tree in the Coding section?