Skip to content

Repository files navigation

Game Frame X Logo

Game Frame X Payment

License Version Unity Version Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams


Documentation · Quick Start · QQ Group: 467608841 / 233840761


English | 简体中文 | 繁體中文 | 日本語 | 한국어

Project Overview

Payment Component - A Unity payment package that provides a unified interface for in-app purchases and subscriptions, supporting Google Play and Apple App Store.

Features

  • Unified interface for in-app purchases and subscriptions
  • Support for Google Play and Apple App Store
  • Easy to integrate and use

Quick Start

Installation

Choose one of the following methods:

  1. Edit your Unity project's Packages/manifest.json and add the scopedRegistries section:

    {
      "scopedRegistries": [
        {
          "name": "GameFrameX",
          "url": "https://gameframex.upm.alianblank.uk",
          "scopes": [
            "com.gameframex"
          ]
        }
      ],
      "dependencies": {
        "com.gameframex.unity.payment": "1.1.0"
      }
    }

    scopes controls which packages are resolved through this registry. Only packages whose names start with com.gameframex will be fetched from it.

  2. Add to manifest.json dependencies:

    {
       "com.gameframex.unity.payment": "https://github.com/gameframex/com.gameframex.unity.payment.git"
    }
  3. Use Package Manager in Unity with Git URL: https://github.com/gameframex/com.gameframex.unity.payment.git

  4. Clone the repository into your Unity project's Packages directory. It will be loaded automatically.

API Reference

Init(bool isDebug = false, bool isClientVerify = true)

Initialize the payment manager.

  • isDebug: Whether to use sandbox mode.
  • isClientVerify: Whether to perform client-side purchase verification.

IsReady()

Check if the payment system is ready.

SetPredefinedProductIds(List<string> inAppProductIds, List<string> subsProductIds)

Set predefined product IDs for preloading.

  • inAppProductIds: List of in-app product IDs.
  • subsProductIds: List of subscription product IDs.

QueryPurchases(string productType)

Query purchase history.

  • productType: Product type, "inapp" or "subs".

ConsumePurchase(string purchaseToken)

Consume a purchase.

  • purchaseToken: The purchase token.

BuyInApp(string productId, string orderId, string offerToken = "", string customData = "")

Initiate an in-app purchase.

  • productId: Product ID or SKU.
  • orderId: Order ID.
  • offerToken: Subscription offer token (subscriptions only).
  • customData: Custom data.

BuySubs(string productId, string orderId, string offerToken = "", string customData = "")

Initiate a subscription purchase.

  • productId: Product ID or SKU.
  • orderId: Order ID.
  • offerToken: Subscription offer token.
  • customData: Custom data.

Buy(string productId, string productType, string offerToken, string orderId, string customData)

Initiate a purchase.

  • productId: Product ID or SKU.
  • productType: Product type, "inapp" or "subs".
  • offerToken: Subscription offer token.
  • orderId: Order ID.
  • customData: Custom data.

Platform Support

Platform Supported
Android (Google Play) Yes
iOS (App Store) Yes

Documentation & Resources

Community & Support

Dependencies

Package Description
com.gameframex.unity 1.1.1

Changelog

See Releases for changelog.

License

See LICENSE.md for license information.

About

GameFrameX Unity Payment base component providing a unified abstraction layer for in-app purchase and payment integration

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages