Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable To Verify Non-Renewing Subscription - (could not parse receipt item) #208

Closed
6 tasks
manky opened this issue May 13, 2017 · 2 comments
Closed
6 tasks

Comments

@manky
Copy link

manky commented May 13, 2017

Platform

  • [ X] iOS
  • macOS
  • tvOS

In app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • [ X] Non-Renewing Subscription

Environment

  • [ X] Sandbox
  • Production

Version

0.9.1

Related issues

N/A

Report

Issue summary

web_order_line_item_id is missing in ReceiptInfo but is exptected to be there acording to
InAppReceipt.swift line 49

`extension ReceiptItem {

public init?(receiptInfo: ReceiptInfo) {
    guard
        let productId = receiptInfo["product_id"] as? String,
        let quantityString = receiptInfo["quantity"] as? String,
        let quantity = Int(quantityString),
        let transactionId = receiptInfo["transaction_id"] as? String,
        let originalTransactionId = receiptInfo["original_transaction_id"] as? String,
        let purchaseDate = ReceiptItem.parseDate(from: receiptInfo, key: "purchase_date_ms"),
        let originalPurchaseDate = ReceiptItem.parseDate(from: receiptInfo, key: "original_purchase_date_ms"),
        let webOrderLineItemId = receiptInfo["web_order_line_item_id"] as? String
        else {
            print("could not parse receipt item: \(receiptInfo). Skipping...")
            return nil
    }`

Error:
could not parse receipt item: ["product_id": product.id, "transaction_id": 1000000298268385, "purchase_date_pst": 2017-05-12 01:19:09 America/Los_Angeles, "original_purchase_date_ms": 1494577149000, "is_trial_period": false, "original_purchase_date_pst": 2017-05-12 01:19:09 America/Los_Angeles, "quantity": 1, "purchase_date_ms": 1494577149000, "purchase_date": 2017-05-12 08:19:09 Etc/GMT, "original_purchase_date": 2017-05-12 08:19:09 Etc/GMT, "original_transaction_id": 1000000298268385]. Skipping... receipt has 1 items, but only 0 were parsed

What did you expect to happen

To verify receipt

What happened instead

Skipping receipt

@vovkaprigarin
Copy link

Problem with let webOrderLineItemId = receiptInfo["web_order_line_item_id"] as? String, because iTunes doesn't include this param in response, and all block under guard became failed :(

I'am catch it problem in verifyPurchase method.

You need fixed this method. Not good if this happens in released apps.

bizz84 added a commit that referenced this issue May 15, 2017
@bizz84
Copy link
Owner

bizz84 commented May 15, 2017

@manky thanks for reporting! Fixed on version 0.9.2.

@bizz84 bizz84 closed this as completed May 15, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants