Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

While restoring cant get original transaction id.. #193

Closed
3 tasks done
kodekarim opened this issue Apr 29, 2017 · 4 comments
Closed
3 tasks done

While restoring cant get original transaction id.. #193

kodekarim opened this issue Apr 29, 2017 · 4 comments

Comments

@kodekarim
Copy link

kodekarim commented Apr 29, 2017

Platform

  • iOS

In app purchase type

  • Auto-Renewable Subscription

Environment

  • Sandbox

Version

ℹ 0.8.5

Related issues

ℹ Please replace this with references to similar issues (either open or already closed).

Report

Issue summary

ℹ Can't able to get original transaction id while restoring

What did you expect to happen

ℹ while restoring I want to get original transaction id.

What happened instead

ℹ but while restoring I am getting transaction id

@bizz84
Copy link
Owner

bizz84 commented May 8, 2017

@abdulKarim002 for restored products, you can access the product.transaction.transactionIdentifier as needed:

public struct Product {
    public let productId: String
    public let transaction: PaymentTransaction
    public let needsFinishTransaction: Bool
}
public protocol PaymentTransaction {
    var transactionState: SKPaymentTransactionState { get }
    var transactionIdentifier: String? { get }
}

restoretransactionid

Are you saying that the transaction id you get is different from the transaction id on the original purchase?

@bizz84
Copy link
Owner

bizz84 commented May 8, 2017

I understand now. Restored transactions have an original: SKPaymentTransaction value that should be returned instead of the default one.

open class SKPaymentTransaction : NSObject {    
    // Only valid if state is SKPaymentTransactionStateRestored.
    @available(iOS 3.0, *)
    open var original: SKPaymentTransaction? { get }
}

I'll treat this as a bug to be fixed

@bizz84
Copy link
Owner

bizz84 commented May 11, 2017

Fix available on pod version 0.9.0.

@bizz84 bizz84 closed this as completed May 11, 2017
@kodekarim
Copy link
Author

Thank @bizz84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants