cordova-plugin-inapppurchase
cordova-plugin-inapppurchase copied to clipboard
iOS redirect for credit card validation
Hi
Thanks again for making this plugin, so user friendly and works great.
I think I might have spotted a problem in iOS but it might be difficult to replicate (but i think it is important), allow me to explain:
- Tap on some button to make purchase
- Apple asks for my password
- Apple says are you sure you want to buy "prodcut_name" and I say yes
- Apple then redirects me to another apple page to update my credit card details
- After updating Apple sends me back to my app but the app doesnt register that a purchase was made and no errors were caught
- I check on iTunes purchase history and Apple has indeed taken my money :-(
What I am doing from a code flow point of view is:
inAppPurchase.getProducts([productId]).then(purchaseCredits).then(consumeCredits).then(verifyCredits).catch(raiseAnException);
purchaseCredits does inAppPurchase.buy(productId) consumeCredits essentially just does inAppPurchase.consume(data.productType, data.receipt, data.signature) and verifyCredits sends the receipt off to my backend to be verified. The problem is I don't get anything on the backend :-(
Have you ever seen this kind of behaviour?
Thanks,
Matt
Hi @mklilley.
I am facing the same issue.
I can add that at step 4, the inAppPurchase.subscribe() promise seems to be rejected. I do not have more precisions about this behavior because it is what I could guess thanks to a user feedback. It is as if the payment process was stopped when the user is redirected to the iTunes settings.
Fortunately we have a restore purchases button in our application that allows users for which the subscription failed to benefit from their subscription. It calls getReceipt() on iOS and it works in this case. But it makes a very poor user experience.
Did you find a way to fix this issue?
Thanks!
Hi @mklilley , I'm experiencing the same issue: no callback is invoked by inAppPurchase.buy(productId) if payment method is set/updated during the purchase process. The workaround proposed by @bsautel does not work in my case because I'm using consumable products and therefore restorePurchases returns nothing. I think this is a serious flaw that invalidate this plugin from being used on iOS (on Android everything seems to work fine) Has anybody found a fix? Moreover, is there a way to test this issue with a debug version? (within sandbox I cannot reproduce). Thanks!
Hey guys, I have seen this exact same issue here too. I'm using ionic so I am thinking about implementing a fix that waits for an app pause event and then calls restore purchases to see if the purchase was actually made or not. It's a pretty hard test case but @itibet you can see the same error come up if you go to the home screen at any point during the transaction process.
I've run in to this issue implementing consumable purchases. I had hoped that calling getReceipt() after returning to the app would provide the receipt for the product, but the product is not included with the receipt that is returned by that method.
@itibet @thielCole What did you end up doing?
Hi @robwebdev, I think this plugin is not maintained any more, I gave up and switched to the following https://github.com/j3k0/cordova-plugin-purchase which seems to work fine.
@robwebdev It's hard to test because I really haven't found a way to test this without making an actual in-app purchase...
Have you found a way to decode the receipt locally, or do you send it to a server to decode the transactions?
Did anyone handle this situation with success since 2016, when this was first opened? It seems like a pretty important use-case and I was wondering if anyone solved this successfully since then.