Prerequisites

Setting up your game

Open your game and check the version of Unity IAP package.

If you already integrated Unity IAP

Go to Package Manager (Window->Package Manager) or open the AssetStore and search for Unity IAP.

If you went through package manager the version should be at least 2.0.8.
If you went through the Asset Store the version should be 1.22

OR

Just import this package to have everything setup for you.

Now please go to Integrating UDP with existing Unity IAP

If you didn't integrate Unity IAP yet

If you don't have IAP setup at all first download the Unity IAP package from here , then set up the in-apps and the UDP part. This is the easiest and cleanest way to get the best results.
You can check more in-depth details about this process here
Once you're done implementing Unity's IAP you can go to Integrating UDP with existing Unity IAP

If you already have IAP integrated but using other solution rather than Unity IAP (like Google Play SDK directly) it's better for you to integrate the standalone SDK.

You can check more in-depth details about this process here