appcelerator-archive / ti.inappbilling

Other
25 stars 32 forks source link

Add External Validation helper #23

Closed nitrag closed 8 years ago

nitrag commented 8 years ago

Validating your receipt externally is a PITA currently, this adds a helper function that returns exactly what you need.

Tested with NPM: in-app-purchase

ashcoding commented 8 years ago

This is to expose getOriginalJson()? getSignature() already exists. Having a method to just return getOriginalJson() instead of a method that returns both Signature and Original Json aka getReceipt() might be better.

What do you think? Is it necessary to combine them into getReceipt()?

nitrag commented 8 years ago

For Google validation, receipt is an object

{ data: "stringified purchase data", signature: "yyyy" }.

It was necessary to expose originalJson because the data has to be in the exact order it was received for valid decoding. So I killed two birds with one proxy method. Sure it might be cleaner to separate it but that's just one more thing to merge properly on the JS side.

ashcoding commented 8 years ago

Ah. Okay. Understood. 👍

ashcoding commented 8 years ago

@nitrag I'm going to have to cherry-pick this put it in another PR. Reason being that there's a need to branch out the ti.inappbilling for support prior to TiSDK 6 and for TiSDK 6 moving forward.

Hope that is okay for you?

nitrag commented 8 years ago

No problem, I'll keep an eye out for the change when I upgrade to 6.0.

On Sep 9, 2016 2:45 AM, "Ashraf" notifications@github.com wrote:

@nitrag https://github.com/nitrag I'm going to have to cherry-pick this put it in another PR. Reason being that there's a need to branch out the ti.inappbilling for support prior to TiSDK 6 and for TiSDK 6 moving forward.

Hope that is okay for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/appcelerator-archive/ti.inappbilling/pull/23#issuecomment-245833256, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMBkoJdlIIKdeAem3YPdiB8LvSGj8rYks5qoQCigaJpZM4J4pqG .

ashcoding commented 8 years ago

I've updated this PR here: https://github.com/appcelerator-archive/ti.inappbilling/pull/24

ashcoding commented 8 years ago

Will be closing this.