Non-consumable purchases

Hello!
I’m trying to implement one-time purchases in the project. The bottom line is as follows:

  1. the user clicks on the button;
  2. there is a purchase;
  3. if the purchase is successful and you click the same button again, a new scene opens.

The IAP Button is located on the required button, and the product ID is filled in (the same in Google Console). In On Purchase Complete, a script is installed that allows you to go to the desired scene. The Consumer Purchase checkbox is removed.

Who can tell you how to implement this process correctly? I’ve redone a lot of ways

You would not want to use Codeless for this. Are you changing the text on the button after they purchase, so they know a new scene will open? Just checking, this would make sense. But you’ll need to add code to the Codeless button scripts to do this which is generally not recommended. And the Consume Purchase option turned off would not work in this case as you expect. This would leave the transaction unfinished. For this custom behavior, you would want to use Scripted IAP, there is an example project here Unity Services - Unity Discussions . I might recommend to get this example working first. Perhaps rename the Toggle button to open your new scene instead, for testing. Sample IAP Project

I’ll try to explain:

  1. The catalog is filled in
  2. I wrote a script that has two variables. One for moving to a new stage in case of a successful purchase, the second - leaves the user on the current stage if the purchase failed.

{
public int _sceneNumber;
public int _sceneNumber2;

public void OnPurchaseComplete(Product product)
{
if(product.definition.id == “4”)
{
SceneManager.LoadScene(_sceneNumber);
}
}

public void OnPurchaseFailure(Product product, PurchaseFailureReason reason)
{
SceneManager.LoadScene(_sceneNumber2);
}

  1. The script is placed on the main camera, the scene numbers are specified.
  2. The IAP Button is placed on the button. The id from the folder is selected. The necessary scripts are installed in On Purchase Complete and On Purchase Failed.

The task is to implement a process so that when you click on the button, a purchase is made and a transition to a new stage is made.

Algorithm for the current state of the app in the play market:
I click on the button that should translate to a new scene → a new scene opens → a window appears about the need for a purchase → I reject the purchase → the scene does NOT change back.
And I need it to change.

6757786--780025--1.jpg
6757786--780025--1.jpg
6757786--780034--3.jpg
6757786--780037--4.jpg

And how can I implement saving a successful purchase? So that after restarting the app, the purchase is saved for the user.

When you mention “IAP Button”, do you mean that you are using Codeless? If so, then you are incorrectly mixing Scripted and Codeless IAP which would not be expected to work. Please start with the known working IAP Sample Project and modify as needed. Get the basics working first, then add your customizations.