Quick Integration

This document illustrates the now.gg Payments Quick Integration flow to enable in-app purchases within your game on Unity.

Tip

  • The Quick Integration flow is simple and fast with minimum code-level changes. However, for more controlled integration, please refer to the Standard Integration flow.

Here is a comparison between the Standard and Quick integrations:

Particulars Quick Integration Standard Integration
Integration Flows You should use the Quick Integration flow only if your IAP implementation is based on Unity’s StandardPurchasingModule. You should use the Standard Integration flow for all other payment integration requirements.
Consumable and Subscription Products Quick Integration flow only supports one-time consumable products. Standard Integration flow supports both consumable and subscription products.

Download and Import the Module

The now.gg Payments Unity module is included as a Unity package file nowgg-payments-login.unitypackage.

Add the module to your Unity project:

  1. Download the package containing the latest version of now.gg Payments module for Unity.
  2. After you have downloaded the module, import it into your Unity project. To do this:
    • Click on Assets > Import Package > Custom Package.
      • Select nowgg-payments-login.unitypackage that you previously downloaded.
    • Select all the listed files and click on Import.
  3. Add Required Dependencies
    • Click on Assets > External Dependency Manager > Android Resolver > Resolve
      This operation will download and add all the required dependencies to the Assets/Plugins/Android directory of your project using the Unity External Dependency Manager.

Important Information

  • Once all the module files have been imported, a folder named ‘NowGGSdk‘ will be added to your project. You can find this folder at the root of the Assets folder.
  • Please do not modify the NowGGSdk folder, as it contains all the assets related to now.gg Payments.

Implement now.gg Payments

Once the now.gg Payments module has been imported, and the dependencies have been added; you can follow this section to implement now.gg Payments with your app/game.

Configure now.gg Purchasing Module

The following steps are required to configure now.gg Purchasing module with your app.

  • Replace the Standard Purchasing Module StandardPurchasingModule.Instance() used in Unity IAP with now.gg Purchasing Module NowGG.Sdk.NowGGPurchasingModule.Instance().
  • Pass the app’s AppId to now.gg Payments module while initializing payments.
  • Ensure that you have added the desired in-app products within nowStudio, which are configured with your Unity Purchasing module.
    • These in-app products will be displayed for the user to buy.
    • For now, now.gg IAP supports only consumable products.

The following sample illustrates these configurations:

public void Start()
 {
  /* Current code
  var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); 
  */

  // Replace with
  var builder = ConfigurationBuilder.Instance(NowGG.Sdk.NowGGPurchasingModule.Instance());
  
  NowGG.Sdk.NowGGPaymentsSdkManager.Instance.AppId = "<your_Payment_ID_here>";
 }

Important Information

  • An initial check is performed to ensure you are initializing the now.gg Payments service on the now.gg Platform.
    • If now.gg IAP is unavailable, the Unity’s StandardPurchasingModule instance will be returned by default in case now.gg Payment isn’t supported.
  • AppId is a unique identifier for your app.
    • The AppId is listed as ‘PAYMENT ID’ under the App Details section of nowStudio. More information.

Reference

×
Text copied to clipboard
Link copied to clipbord
Questions? Please reach out to us at dev-support@now.gg