Update Stripe module at Parse Cloud Code

余生颓废 提交于 2019-12-22 09:32:30

问题


Turns out that Stripe module at Parse Could Code is out of date and won't be updated.

Source:

https://developers.facebook.com/bugs/523104684492016/

Parse modules are using an old version of the API and there is no plan to update it in the near future.

As a workaround please download the newer SDKs directly off the third party site, place it in "cloud/" folder and import it using require();

We're going to close this by design.

I have downloaded Stripe module via terminal with command

npm install stripe

I'm trying to import this module but when I deploy it to Parse, it seems that most of the modules are missing. I get errors like this:

Update failed with Error: Module child_process.js not found at node_modules/stripe/lib/stripe.js:24:12

Hope someone can point me out on how to add third party modules to Parse Cloud Code properly. Thanks.


回答1:


Seems that Parse's module support is really limited and adding submodules is impossible or too complex to even bother, that's why I decided to move to Heroku. Thanks for all answers!




回答2:


I know that this is a bit old, but my "workaround" was, rather than importing the module, convert the cURL requests from Stripe's documentation to Parse.Cloud.httpRequests. You can get access to the entire API that way.



来源:https://stackoverflow.com/questions/29857178/update-stripe-module-at-parse-cloud-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!