question

Eliot avatar image
Eliot asked

Linefeeds (newlines) in purchaseToken from SDK Tester

I've noticed that in several test purchases I have recently made using the SDK Tester app of consumable SKUs I specified in the JSON file, purchaseTokens being returned to me by the getPurchaseToken() method on the Receipt object contain multiple linefeed characters (a linefeed is an 0A in hex.) First of all, this seems strange, but also this is not a valid character to use in an HTTP request. What is the correct way to pass this purchaseToken to the Receipt Verification Service? Should I be encoding this as a %0A in my request to the service? Is it safe to treat this as a 'whitespace' character and strip it? Here's an example of one of these tokens I just dumped to a file directly from the getPurchaseToken() method running on my test Kindle device - there is an embedded linefeed and a trailing linefeed character: https://gist.github.com/fadookie/7609765f3e98c37c1c20 Also, should I expect linefeeds in the purchaseToken in a production environment? Thank you. Message was edited by: Eliot
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Eliot avatar image
Eliot answered
I found this was addressed already, sorry. I was searching for this issue on this forum (Implementation) but it had been answered on the testing forum: https://forums.developer.amazon.com/forums/thread.jspa?messageID=427ƫ
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.