node-apple-receipt-verify icon indicating copy to clipboard operation
node-apple-receipt-verify copied to clipboard

Getting Error 21004 on non auto-renewing subscription

Open YogiBear52 opened this issue 5 years ago • 2 comments

Hello,

I am using this library already few months, and I have been starting to get this '21004' lately and constantly on each 'Consumable' product.

After looking on these posts: https://developer.apple.com/forums/thread/72991 https://developer.apple.com/forums/thread/126122?page=2

I have tried to remove the 'password' from the request content ('secret' as provided in config object) and everything works.

I guess Apple has just stringent their receipt validation API so now its possible to send the 'password' only for 'auto-renewing' subscription. It's working for me without the 'password' but I have no way to check it for other type of products like 'auto-renewing'.

By the way, in the Docs: secret - [string] [optional] - Apple shared secret (See it in iTunes Connect: Go to My Apps > (select your app) > In-App Purchases > View or generate a shared secret) [required] it's both [optional] and [required] :)

I guess to solve it we would have to make the 'secret' key optional.

Thanks

YogiBear52 avatar Jul 27 '20 09:07 YogiBear52

i can add special behavior for this situation: remove password from query when this error is returned and then make second try

ladeiko avatar Aug 03 '20 02:08 ladeiko

tried this with curl and found that sending password to Apple for non-subscription results in 21003 for me.

mobyjames avatar Jan 19 '21 00:01 mobyjames