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

Does Superwall provide "receipt_data" and "transaction_id" ? #274

Closed
dimpy-iroid opened this issue Dec 6, 2024 · 7 comments
Closed

Does Superwall provide "receipt_data" and "transaction_id" ? #274

dimpy-iroid opened this issue Dec 6, 2024 · 7 comments

Comments

@dimpy-iroid
Copy link

I have to send "receipt_data" and "transaction_id" to the server. Where do I get these?

@anglinb
Copy link
Collaborator

anglinb commented Dec 6, 2024

Hey @dimpy-iroid! You can get the transaction id from the SuperwallDelegate 👉 https://superwall.com/docs/3rd-party-analytics#3rd-party-analytics

Does that seem like what you're looking for?

@dimpy-iroid
Copy link
Author

Hello @anglinb,
Thank you for the response!

I have implemented it in my code:

// MARK: - Superwall Delegate
extension SettingScreen: SuperwallDelegate {
    func handleSuperwallEvent(withInfo eventInfo: SuperwallEventInfo) {
        switch eventInfo.event {
        case .transactionComplete(let transaction, let product, let paywallInfo):
            print("Converted from paywall originalTransactionIdentifier: \(transaction?.originalTransactionIdentifier ?? "")")
            print("Converted from paywall storeTransactionId: \(transaction?.storeTransactionId ?? "")")
            print("Converted from paywall productIdentifier: \(product.productIdentifier)")
            print("Converted from paywall paywallInfo: \(paywallInfo.identifier)")
        case .transactionRestore(let restoreType, let paywallInfo):
            print("transactionRestore restoreType \(restoreType)")
        default:
            print("default \(#function) - \(eventInfo.event)")
        }
    }
}

There are two IDs, "originalTransactionIdentifier" and "storeTransactionId"; I'm not sure which ID is the transaction id from these two!!
I tested the subscription on two different devices in the sandbox environment with the same testing account. And I got the same originalTransactionIdentifier in both devices!

@anglinb
Copy link
Collaborator

anglinb commented Dec 12, 2024

The original transaction ID can be thought of like a subscription ID. But it also happens to be the very first transaction in the subscription as well.

@dimpy-iroid
Copy link
Author

dimpy-iroid commented Dec 12, 2024

Yes, Thank you for your response. I got the answer. But how do I get "receipt_data" from Superwall?

@anglinb
Copy link
Collaborator

anglinb commented Dec 12, 2024

Can you tell me more about what data you're looking for? We expose a bunch of information on the transaction_complete event: https://superwall.com/docs/tracking-analytics#superwall-events If there's something missing, we can definitely add it there. We don't currently expose the receipt itself. If you wanted to do verification on your server, would be easier to take the original transaction id and use the App Store Server API instead.

@anglinb
Copy link
Collaborator

anglinb commented Jan 8, 2025

Closing this since I haven't hear back, hopefully that was what you needed!

@anglinb anglinb closed this as completed Jan 8, 2025
@dimpy-iroid
Copy link
Author

Yes, we solved this issue, Thank you for your response!

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

No branches or pull requests

2 participants