libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
224 stars 83 forks source link

Transaction data not returned for iOS #160

Closed lozan closed 6 years ago

lozan commented 6 years ago

In my application I am using the purchase receipt for verification. However, if I make a purchase on AppStore I am only getting TransactionDataSignature and getTransactionData() always returns null.

This is unusable in my case, because the users cannot get what they paid for without verification on my server. With getTransactionDataSignature I can bet the base64 encoded signature, but as I said, in my case (any many others) it's useless.

lozan commented 6 years ago

By the way, this is for MOE, not RoboVM

keesvandieren commented 6 years ago

We currently have no app with MOE running with gdx-pay.

Have you tried debugging the issue yourself?

It is not hard to do that. Steps:

Probably there is something wrong with these statements:

    if (payment.requestData() != null) {
        final String transactionData;
        transactionData = payment.requestData().base64EncodedStringWithOptions(0);
        transaction.setTransactionData(transactionData);
    } else {
        transaction.setTransactionData(null);
    }
lozan commented 6 years ago

It seems that your implementation is good. My bad. At my validation server we used https://developer.apple.com/documentation/storekit/skpaymenttransaction/1617722-transactionreceipt

However, that function is deprecated since iOS 7 (although it still works on iOS 11). So, we'll update the server-side implementation. I don't see a point in adding that transactionReceipt in gdx-pay.

Thanks

lozan commented 6 years ago

By the way, In case you need a validation for the MOE implementation, it does what it's supposed to and returns the correct data. there's just no way to get the transactionReceipt property of SKPaymentTransaction, and that was my issue.

keesvandieren commented 6 years ago

Thanks for responding, closing issue

gagbaghdas commented 5 years ago

Hi Guys. Experiencing now the same issue with the 1.0.0 version and RoboVM. payment.requestData() is always null.

Do you have any ideas? With the previous version, everything was ok .

gagbaghdas commented 5 years ago

@MrStahlfelge @keesvandieren @Tom-Ski