Unity Package Manager helpers for MakePay checkout flows in games, interactive apps, and digital goods experiences.
This package is intentionally client-safe. It opens checkout URLs, parses return/deep-link URLs, and calls your own backend to create checkout sessions. MakePay credentials and webhook verification stay on your server.
In Unity, open Window > Package Manager > Add package from git URL and use:
https://github.com/makecryptoio/makepay-unity.git
The package name is io.makepay.unity.
- Unity sends cart/order/player context to your backend.
- Your backend creates a MakePay checkout link and returns JSON.
- Unity opens the checkout URL with
Application.OpenURL. - MakePay redirects back to your configured deep link.
- Unity parses the return URL for UI state only.
- Your backend grants durable entitlements after receiving and verifying the MakePay webhook.
sequenceDiagram
participant Unity
participant Backend as Game backend
participant MakePay
Unity->>Backend: POST /checkout
Backend->>MakePay: Create checkout
MakePay-->>Backend: checkoutUrl
Backend-->>Unity: checkoutUrl
Unity->>MakePay: Open checkout URL
MakePay-->>Unity: Deep-link return
MakePay-->>Backend: Webhook confirmation
Backend-->>Unity: Entitlement available
using MakePay.Unity;
using UnityEngine;
public sealed class BuyCredits : MonoBehaviour
{
public void Buy()
{
var request = new MakePayCheckoutSessionRequest
{
externalId = "order_123",
amountMinor = 999,
currency = "USD",
description = "Starter credit pack",
successUrl = MakePayCheckout.BuildReturnUrl("mygame", "makepay/return", "order_123"),
cancelUrl = MakePayCheckout.BuildReturnUrl("mygame", "makepay/cancel", "order_123")
};
StartCoroutine(MakePayBackendClient.CreateCheckoutSession(
"https://api.example.com/payments/makepay/checkout",
request,
response => MakePayCheckout.OpenCheckoutUrl(response.checkoutUrl),
error => Debug.LogError(error.message)));
}
}Your backend should return:
{
"checkoutUrl": "https://checkout.makepay.io/pay/example",
"sessionId": "session_123",
"externalId": "order_123",
"expiresAt": "2026-05-29T12:00:00Z"
}MakePayCheckoutResult result;
if (MakePayCheckoutResult.TryParse(url, out result) && result.IsPaid)
{
Debug.Log("Show a pending confirmation state until the backend confirms the webhook.");
}- Do not ship MakePay credentials in a Unity build.
- Do not grant durable goods based only on client-side return parameters.
- Treat
MakePayCheckoutResultas a UI signal. - Grant ranks, credits, skins, or subscriptions only after your backend verifies a paid webhook and stores the entitlement.
- Use your backend to map
externalIdto an authenticated player/order.
Import the Checkout Button sample from Package Manager. It contains a small MonoBehaviour that posts to a backend checkout endpoint and opens the returned checkout URL.
This repository validates package metadata and safety constraints with:
npm run validateUnity Editor tests live under Tests/Runtime and can be run from the Unity Test Runner in a Unity 2021.3+ project.