Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds receipt validation endpoint #515

Merged
merged 2 commits into from
Feb 20, 2016
Merged

Adds receipt validation endpoint #515

merged 2 commits into from
Feb 20, 2016

Conversation

flovilmart
Copy link
Contributor

Proposed fix for #134

Exposes /validate_purchase endpoint like expected in the iOS SDK.

- Adds automatic downloadName to match original Parse API
@facebook-github-bot
Copy link

@flovilmart updated the pull request.

@flovilmart
Copy link
Contributor Author

It also add a requiredColumns concept to the schema to validate that the products are properly formed when created and that a user can't delete a key that is required too.

Any other Schema could benefit that feature as it's baked into the validateObject method.

@nlutsenko
Copy link
Contributor

Looks great, minus style nits, but they don't matter here, since we don't have jslint/jshint/etc yet... (it's coming). I can help test this e2e with App Store next week, if you need it...

@flovilmart
Copy link
Contributor Author

your call!
This should not be affected much by any other change on master I believe

@nlutsenko
Copy link
Contributor

Ok, great... Do we want to wait for e2e test or merge as is and then test?

nlutsenko added a commit that referenced this pull request Feb 20, 2016
@nlutsenko nlutsenko merged commit 78c5292 into parse-community:master Feb 20, 2016
@nlutsenko
Copy link
Contributor

W00t!

@flovilmart
Copy link
Contributor Author

🎉 🍻

@francesc-o
Copy link

So, sorry for the question, but does parse server now fully support the SDK's class PFPurchase and all its methods, including restore?
Thanks

@LiamInJapan
Copy link

I seem to be able to do purchases through PFPurchase, but restore seems to break with the following error:

Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

Thanks for a great piece of software!

@flovilmart flovilmart deleted the receipt-validation branch February 9, 2017 03:29
@flovilmart
Copy link
Contributor Author

Can you provide the logs when running with VERBOSE=1?

Not sure we implemented the restauration end points.

@LiamInJapan
Copy link

Not having a restore purchases button is grounds for app rejection on the Apple App Store :(

Here's the heroku-side output with VERBOSE=1:

2017-02-09T05:27:36.568640+00:00 app[web.1]: verbose: REQUEST for [POST] /parse/validate_purchase: {
2017-02-09T05:27:36.568658+00:00 app[web.1]: "receipt": {
2017-02-09T05:27:36.568659+00:00 app[web.1]: "__type": "Bytes",
2017-02-09T05:27:36.568696+00:00 app[web.1]: "base64": "<big load of base 64>"
2017-02-09T05:27:36.568697+00:00 app[web.1]: },
2017-02-09T05:27:36.568698+00:00 app[web.1]: "productIdentifier": "com.blah.pack1"
2017-02-09T05:27:36.568709+00:00 app[web.1]: } method=POST, url=/parse/validate_purchase, host=sheltered-woodland-11191.herokuapp.com, connection=close, x-parse-client-version=i1.14.2, accept=/, x-parse-application-id=VPlIRFrvneMiaMv17VxZmgUFkQ9NM0T3XwWjbHie, x-parse-client-key=lMqO5zipE1ISOylnhgzwWxQ8KS2jQofOLggi2i2o, x-parse-installation-id=c8ecbfcc-b1f0-4c83-b6dc-976fde0721fb, accept-language=en-gb, x-parse-os-version=10.2 (14C92), accept-encoding=gzip, deflate, content-type=application/json; charset=utf-8, user-agent=Words/1.2.1 CFNetwork/808.2.16 Darwin/16.3.0, x-parse-app-build-version=1.2.1, x-parse-app-display-version=1.2.1, x-request-id=b336d06c-56a3-4031-a190-581c709f2bc8, x-forwarded-for=106.132.216.135, x-forwarded-proto=https, x-forwarded-port=443, via=1.1 vegur, connect-time=1, x-request-start=1486618056333, total-route-time=0, content-length=6959, __type=Bytes, base64=, productIdentifier=com.blah.pack1
2017-02-09T05:27:37.207664+00:00 app[web.1]: error: the handler did not include a "response" or a "location" field
2017-02-09T05:27:37.209986+00:00 app[web.1]: (node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): control should not get here
2017-02-09T05:27:37.210629+00:00 app[web.1]: (node:17) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2017-02-09T05:28:06.578359+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/validate_purchase" host=sheltered-woodland-11191.herokuapp.com request_id=b336d06c-56a3-4031-a190-581c709f2bc8 fwd="106.132.216.135" dyno=web.1 connect=1ms service=30243ms status=503 bytes=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants