Search Unity

Retrieve the Transaction ID from GameFoundation

Discussion in 'Game Foundation' started by Reelsy, Sep 30, 2020.

  1. Reelsy

    Reelsy

    Joined:
    Jan 12, 2020
    Posts:
    7
    Hello everyone,

    I am searching for how to retrieve the purchase receipt from GF when an IAP transaction is completed.
    Is there a way to do it in GF?

    THank you in advance.
     
  2. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Currently, there is not an event that exposes the current PurchaseEventArgs.

    If your goal is only receipt validation, the built-in receipt validation is an option. You would just provide the tangles to TransactionManager right after initialization, like so:

    Code (CSharp):
    1. GameFoundation.Initialize(
    2.     dataLayer: m_MyDataLayer,
    3.     onInitializeCompleted: () =>
    4.     {
    5.         TransactionManager.SetIAPValidator(
    6.             new CrossPlatformValidator(
    7.                 GooglePlayTangle.Data(),
    8.                 AppleTangle.Data(),
    9.                 Application.identifier));
    10.     });
     
    erika_d likes this.