服务器收据验证有一个奇怪的问题

时间:2019-06-06 02:07:10

标签: ios in-app-purchase receipt

我正在开发一个支持IAP的应用程序,我想使用我的服务器来验证收据。

当我向服务器发送数据以验证收据时,有时它可以正常工作,但有时会出现这样的错误。 我用邮递员尝试了同样的数据,它很有趣。

list version="1.0">
<dict>
<key>pings</key>
<array></array>
<key>metrics</key>
<dict>
  <key>dialogId</key><string>exception</string>
  <key>message</key><string>exception_message</string>
  <key>eventType</key><string>dialog</string>
  <key>actionUrl</key><string>buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/verifyReceipt</string>
</dict>
<key>failureType</key><string></string>
<key>customerMessage</key><string>exception_message</string>
<key>m-allowed</key><false/>
<!--
Copy this when sending an error email or filing a radar.

Exception:
java.lang.reflect.InvocationTargetException Back Trace:
java.lang.reflect.InvocationTargetException
    at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:281)
    at com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:167)
    at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1880)
    at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1136)
    at com.apple.jingle.foundation.appserver.MZSimpleApplication.simpleDispatchRequest(MZSimpleApplication.java:399)
    at com.apple.jingle.foundation.appserver.MZSimpleApplication.dispatchRequest(MZSimpleApplication.java:350)
    at com.apple.jingle.appserver.MZApplication.dispatchRequest(MZApplication.java:1482)
    at com.apple.jingle.commercelogic.MZFraudMessagingApplication.dispatchRequest(MZFraudMessagingApplication.java:111)
    at com.apple.jingle.app.finance.Application.dispatchRequest(Application.java:1044)
    at com.apple.jingle.app.finance.Application.dispatchRequest(Application.java:859)
    at com.apple.jingle.foundation.appserver.MZWorkerThread.dispatchRequest(MZWorkerThread.java:157)
    at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:571)
    at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:747)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IndexOutOfBoundsException
    at java.io.PushbackInputStream.read(PushbackInputStream.java:170)
    at com.webobjects.appserver._private.WOChunkedInputStream.readBytes(WOChunkedInputStream.java:238)
    at com.webobjects.appserver._private.WOChunkedInputStream.read(WOChunkedInputStream.java:60)
    at com.webobjects.foundation.NSData.&lt;init&gt;(NSData.java:250)
    at com.webobjects.appserver._private.WOInputStreamData._extractBytesFromInputStream(WOInputStreamData.java:113)
    at com.webobjects.appserver._private.WOInputStreamData.bytesNoCopy(WOInputStreamData.java:157)
    at com.webobjects.foundation.NSData._bytesNoCopy(NSData.java:499)
    at com.webobjects.appserver.WOMessage.contentString(WOMessage.java:852)
    at com.apple.jingle.util.MZAffiliateRequestUtil.requestUriHasAffiliateDataThatRequiresACookieSet(MZAffiliateRequestUtil.java:44)
    at com.apple.jingle.redirect.MZRedirector$2.requestIsBountiable(MZRedirector.java:320)
    at com.apple.jingle.redirect.MZRedirector$2.process(MZRedirector.java:235)
    at com.apple.jingle.redirect.MZRedirector.redirectForRequest(MZRedirector.java:94)
    at com.apple.jingle.app.store.MZWebLinkableDirectAction.performActionNamed(MZWebLinkableDirectAction.java:44)
    at com.apple.jingle.app.finance.DirectAction.performActionNamed(DirectAction.java:414)
    at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:269)
    ... 13 more
    Extra Info:
nullNote that double hyphens have silently been truncated to single hyphens in this
comment section.
-->
<key>dialog</key>
<dict><key>m-allowed</key><false/>
<key>message</key><string>Your request is temporarily unable to be processed.</string>
<key>explanation</key><string>Please try again later.</string>
<key>defaultButton</key><string>ok</string>
<key>okButtonString</key><string>OK</string>
<key>initialCheckboxValue</key><true/></dict>
</dict>
</plist>

2 个答案:

答案 0 :(得分:0)

我们也看到了这些错误-您所做的应该没有任何问题。不幸的是,解决方案是:

  

请稍后再试。

答案 1 :(得分:0)

如果您使用错误的URL进行沙盒测试,则可能会出现此错误。

生产网址:https://buy.itunes.apple.com/verifyReceipt

沙盒网址:https://sandbox.itunes.apple.com/verifyReceipt