Wizcorp / node-iap

In-app purchase validation for Apple, Google, Amazon, Roku
262 stars 92 forks source link

[Apple] Sandbox testing no longer works #49

Closed dawidvdh closed 4 years ago

dawidvdh commented 6 years ago

When I try and do a sandbox test with iOS, I receive the following error:

error { Error: getaddrinfo ENOTFOUND buy.itunes.apple.com buy.itunes.apple.com:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'buy.itunes.apple.com',
  host: 'buy.itunes.apple.com',
  port: 443 }
justinpage commented 6 years ago

@dawidvdh Are you still experiencing this issue? I can have this tested against the latest RC with our sandbox app.

dawidvdh commented 6 years ago

Hey @justinpage, I have no Idea had to switch to a different server based solution as I couldn't get this to work the last time I attempted it.

adamthewan commented 6 years ago

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

In the test environment, use https://sandbox.itunes.apple.com/verifyReceipt as the URL. In production, use https://buy.itunes.apple.com/verifyReceipt as the URL.

ronkorving commented 6 years ago

@adamthewan The library detects this and automatically switches from production to sandbox if the receipt needs that. See https://github.com/Wizcorp/node-iap/blob/master/lib/apple/index.js#L185-L188

maxence-machu commented 5 years ago

@dawidvdh , are you using Firebase Functions ?

If you do, you must enable Flame or Blaze formula in your account since Firebase Function doesn't allow external network requests when billing account is not configured.

"Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions"

justinpage commented 4 years ago

@ronkorving I think we can close this issue.