Closed testower closed 10 years ago
Could you briefly elaborate, what advantages parse brings with it?
wait, parse.com requires it's clients to change modules ?
You can't use the 'https' module in Parse Cloud, so to make https requests, you must use Parse.Cloud.httpRequest. Also, Buffer has to be explicitly required.
I realize this is perhaps not something you'd want to have in the normal distribution, but I'm sure others could find it useful to easily integrate paymill as an alternative to Stripe.
Edit: Stripe is the payment solution that Parse.com supports (by providing their module in their "Cloud")
You can't just use any module in Parse.com. There are only some predefined modules available, and https is not one of them.
@testower wow, thanks for that, i'm never going to use parse.com.
Please explain what parse.com is.
Parse.com is a Backend-as-a-Service for mobile and web apps. You can also deploy node.js-type code to its "cloud" and expose it to your clients.
Would it be possible to make this more generic? I would think a flag "usehttps" and have that set to true by default and parse users would simply set that to false?
Yeah, I like that. It would require an injection of the alternative request function though.
Edit:
Acutally that will not work as: "All your requests must be made via https. Requests which will be made in another way will fail. This is for security reasons of the submitted data." - https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#document-authentication
Parse.Cloud.httpRequest will make https request if "https" is given in request url, as opposed to "http". The solution is tested and works against paymill.
Sorry, I understood what you meant now by "setting a flag" now, and simply use a normal http request if "usehttps" is set to false. That will not work with Parse either, as all http requests, https or not, must be made with Parse's internal method.
What now? I don't think I want to merge a cloud provider specific implementation. Next thing you know there will be 100 if statements at the top.
For now I could just post the Parse-specific solution on my own github, for anyone that's interested. I completely understand that you don't want to merge this :-)
Example: