Include In-App Purchases sample code into existing project

I'm very confused regarding how to handle the sample project. I have my app project right? So I open it. I download the sample project and open it on another window. How do I integrate the iOS payment target functionality to my existing app? What do I have to copy to my app and how?

The most useful information the documentation says is this:

5. For iOS and tvOS devices, build and run the InAppPurchases and InAppPurchasestvOS targets, respectively, which the sample uses to build InAppPurchases.

which doesn't help at all. Ok so on the new Window I opened with the sample project I put my bundle id and product id and it works... now how do I copy that target or whatever it's linking the purchase to my app?


Where are all the engineers apple mentioned in the WWDC20?? It's incredible that even to give them 30% of my earnings I have to beg... Is anyone able to help with this...? I've been with this issue for 2 weeks already
The Offering, Completing, and Restoring In-App Purchases sample you're working with is meant to be an example implementation of an app using the StoreKit Framework, to guide your own app. Rather than copying pieces of the sample app into your existing app, I suggest writing your own code using StoreKit so that in-app purchases integrate seamlessly into your app. To help you on the way, try following the documentation in the sample code, or watching this helpful session: Using StoreKit for In-App Purchases in Swift 3.

The reason purchases work in the sample project is because the bundle & product identifiers you entered match what you configured in App Store Connect. Once you start to implement in app purchases into your app using StoreKit, you'll need to make sure the bundle identifier for your app is registered in App Store Connect, along with product identifiers for your products, before you'll be able to test your implementation with the sandbox environment.

At WWDC this year, we announced a new feature to make testing in-app purchases even easier by allowing you to test them locally using Xcode. This way, you can start testing your implementation of in-app purchases before you even start to configure anything in App Store Connect. Here are some great resources to get you started:
Include In-App Purchases sample code into existing project
 
 
Q