initital push

This commit is contained in:
Savya Bikram Shah
2026-05-07 14:18:36 +05:45
commit 2223b2d3ae
146 changed files with 8618 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Changelog
All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [0.1.0] - 2026-05-07
### This is the first release of *\<Fonepay Unity\>*.
*Short description of this release*

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 447b7ed65abae475788ba71349c47ca1
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d97f7922b43d34693a60a2786cda5aa3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,169 @@
>>>
**_Package Documentation Template_**
Use this template to create preliminary, high-level documentation meant to introduce users to the feature and the sample files included in this package. When writing your documentation, do the following:
1. Follow instructions in blockquotes.
2. Replace angle brackets with the appropriate text. For example, replace "&lt;package name&gt;" with the official name of the package.
3. Delete sections that do not apply to your package. For example, a package containing only sample files does not have a "Using &lt;package_name&gt;" section, so this section can be removed.
4. After documentation is completed, make sure you delete all instructions and examples in blockquotes including this preamble and its title:
```
>>>
Delete all of the text between pairs of blockquote markdown.
>>>
```
>>>
# About &lt;package name&gt;
>>>
Name the heading of the first topic after the **displayName** of the package as it appears in the package manifest.
This first topic includes a brief, high-level explanation of the package and, if applicable, provides links to Unity Manual topics.
There are two types of packages:
- Packages that include features that augment the Unity Editor or Runtime.
- Packages that include sample files.
Choose one of the following introductory paragraphs that best fits the package:
>>>
Use the &lt;package name&gt; package to &lt;list of the main uses for the package&gt;. For example, use &lt;package name&gt; to create/generate/extend/capture &lt;mention major use case, or a good example of what the package can be used for&gt;. The &lt;package name&gt; package also includes &lt;other relevant features or uses&gt;.
> *or*
The &lt;package name&gt; package includes examples of &lt;name of asset type, model, prefabs, and/or other GameObjects in the package&gt;. For more information, see &lt;xref to topic in the Unity Manual&gt;.
>>>
**_Examples:_**
Here are some examples for reference only. Do not include these in the final documentation file:
*Use the Unity Recorder package to capture and save in-game data. For example, use Unity Recorder to record an mp4 file during a game session. The Unity Recorder package also includes an interface for setting-up and triggering recording sessions.*
*The Timeline Examples package includes examples of Timeline assets, Timeline Instances, animation, GameObjects, and scripts that illustrate how to use Unity's Timeline. For more information, see [ Unity's Timeline](https://docs.unity3d.com/Manual/TimelineSection.html) in the [Unity Manual](https://docs.unity3d.com). For licensing and usage, see Package Licensing.*
>>>
# Installing &lt;package name&gt;
>>>
Begin this section with a cross-reference to the official Unity Manual topic on how to install packages. If the package requires special installation instructions, include these steps in this section.
>>>
To install this package, follow the instructions in the [Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html).
>>>
For some packages, there may be additional steps to complete the setup. You can add those here.
>>>
In addition, you need to install the following resources:
- &lt;name of resource&gt;: To install, open *Window > &lt;name of menu item&gt;*. The resource appears &lt;at this location&gt;.
- &lt;name of sample&gt;: To install, open *Window > &lt;name of menu item&gt;*. The new sample folder appears &lt;at this location&gt;.
<a name="UsingPackageName"></a>
# Using &lt;package name&gt;
>>>
The contents of this section depends on the type of package.
For packages that augment the Unity Editor with additional features, this section should include workflow and/or reference documentation:
* At a minimum, this section should include reference documentation that describes the windows, editors, and properties that the package adds to Unity. This reference documentation should include screen grabs (see how to add screens below), a list of settings, an explanation of what each setting does, and the default values of each setting.
* Ideally, this section should also include a workflow: a list of steps that the user can easily follow that demonstrates how to use the feature. This list of steps should include screen grabs (see how to add screens below) to better describe how to use the feature.
For packages that include sample files, this section may include detailed information on how the user can use these sample files in their projects and scenes. However, workflow diagrams or illustrations could be included if deemed appropriate.
## How to add images
*(This section is for reference. Do not include in the final documentation file)*
If the [Using &lt;package name&gt;](#UsingPackageName) section includes screen grabs or diagrams, a link to the image must be added to this MD file, before or after the paragraph with the instruction or description that references the image. In addition, a caption should be added to the image link that includes the name of the screen or diagram. All images must be PNG files with underscores for spaces. No animated GIFs.
An example is included below:
![A cinematic in the Timeline Editor window.](images/example.png)
Notice that the example screen shot is included in the images folder. All screen grabs and/or diagrams must be added and referenced from the images folder.
For more on the Unity documentation standards for creating and adding screen grabs, see this confluence page: https://confluence.hq.unity3d.com/pages/viewpage.action?pageId=13500715
>>>
# Technical details
## Requirements
>>>
This subtopic includes a bullet list with the compatible versions of Unity. This subtopic may also include additional requirements or recommendations for 3rd party software or hardware. An example includes a dependency on other packages. If you need to include references to non-Unity products, make sure you refer to these products correctly and that all references include the proper trademarks (tm or r)
>>>
This version of &lt;package name&gt; is compatible with the following versions of the Unity Editor:
* 2018.1 and later (recommended)
To use this package, you must have the following 3rd party products:
* &lt;product name and version with trademark or registered trademark.&gt;
* &lt;product name and version with trademark or registered trademark.&gt;
* &lt;product name and version with trademark or registered trademark.&gt;
## Known limitations
>>>
This section lists the known limitations with this version of the package. If there are no known limitations, or if the limitations are trivial, exclude this section. An example is provided.
>>>
&lt;package name&gt; version &lt;package version&gt; includes the following known limitations:
* &lt;brief one-line description of first limitation.&gt;
* &lt;brief one-line description of second limitation.&gt;
* &lt;and so on&gt;
>>>
*Example (For reference. Do not include in the final documentation file):*
The Unity Recorder version 1.0 has the following limitations:*
* The Unity Recorder does not support sound.
* The Recorder window and Recorder properties are not available in standalone players.
* MP4 encoding is only available on Windows.
>>>
## Package contents
>>>
This section includes the location of important files you want the user to know about. For example, if this is a sample package containing textures, models, and materials separated by sample group, you may want to provide the folder location of each group.
>>>
The following table indicates the &lt;describe the breakdown you used here&gt;:
|Location|Description|
|---|---|
|`<folder>`|Contains &lt;describe what the folder contains&gt;.|
|`<file>`|Contains &lt;describe what the file represents or implements&gt;.|
>>>
*Example (For reference. Do not include in the final documentation file):*
The following table indicates the root folder of each type of sample in this package. Each sample's root folder contains its own Materials, Models, or Textures folders:
|Folder Location|Description|
|---|---|
|`WoodenCrate_Orange`|Root folder containing the assets for the orange crates.|
|`WoodenCrate_Mahogany`|Root folder containing the assets for the mahogany crates.|
|`WoodenCrate_Shared`|Root folder containing any material assets shared by all crates.|
>>>
## Document revision history
>>>
This section includes the revision history of the document. The revision history tracks when a document is created, edited, and updated. If you create or update a document, you must add a new row describing the revision. The Documentation Team also uses this table to track when a document is edited and its editing level. An example is provided:
|Date|Reason|
|---|---|
|Sept 12, 2017|Unedited. Published to package.|
|Sept 10, 2017|Document updated for package version 1.1.<br>New features: <li>audio support for capturing MP4s.<li>Instructions on saving Recorder prefabs|
|Sept 5, 2017|Limited edit by Documentation Team. Published to package.|
|Aug 25, 2017|Document created. Matches package version 1.0.|
>>>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: db08287d38c1f43dea2c5c29e7185436
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7f9dbf7477f88405ca98d50075ced835
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -0,0 +1,182 @@
fileFormatVersion: 2
guid: 4b1c61f6439b24b68bfbbe3420460669
TextureImporter:
internalIDToNameTable:
- first:
213: -8196121713257968172
second: example_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: example_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 748
height: 249
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 4dd84690ab6814e80800000000000000
internalID: -8196121713257968172
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
example_0: -8196121713257968172
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b0399dbb25024efbbe82e3f53f61b7f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
{
"name": "Darkmatter.FonepayUnity.Editor",
"rootNamespace": "Darkmatter.Fonepay.Editor",
"references": [
"Darkmatter.FonepayUnity"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e655521fa332549829d66024acdbcc5c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
namespace Darkmatter.Fonepay.Editor
{
/// <summary>
/// Bakes EditorPrefs secrets into a temporary Resources asset before player build,
/// then deletes the asset after the build (success or fail) so secrets never linger on disk.
/// </summary>
internal sealed class FonepayBuildSecretsInjector : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
private const string ResourcesDir = "Assets/Resources";
private const string AssetPath = "Assets/Resources/FonepayBakedSecrets.asset";
public int callbackOrder => 0;
public void OnPreprocessBuild(BuildReport report)
{
if (!FonepaySecretsStore.HasAll())
throw new BuildFailedException(
"Fonepay secrets missing. Open Tools > Fonepay > Settings before building.");
if (!Directory.Exists(ResourcesDir))
Directory.CreateDirectory(ResourcesDir);
var baked = ScriptableObject.CreateInstance<FonepayBakedSecrets>();
baked.password = FonepaySecretsStore.GetPassword();
baked.secretKey = FonepaySecretsStore.GetSecretKey();
AssetDatabase.CreateAsset(baked, AssetPath);
AssetDatabase.SaveAssets();
}
public void OnPostprocessBuild(BuildReport report)
{
if (AssetDatabase.LoadAssetAtPath<FonepayBakedSecrets>(AssetPath) != null)
AssetDatabase.DeleteAsset(AssetPath);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: abf4fd45c03134382a1e0052168c60c7

View File

@@ -0,0 +1,42 @@
using UnityEditor;
using UnityEngine;
namespace Darkmatter.Fonepay.Editor
{
/// <summary>
/// Per-project secret storage backed by EditorPrefs.
/// Keys are namespaced with project path hash so different machines/projects never collide.
/// EditorPrefs lives in OS user store (Keychain on macOS, registry on Windows) — not in repo.
/// </summary>
public static class FonepaySecretsStore
{
private const string PrefixBase = "Darkmatter.Fonepay.";
private static string ProjectKey =>
PrefixBase + Application.dataPath.GetHashCode().ToString("X") + ".";
public static string PasswordKey => ProjectKey + "Password";
public static string SecretKeyKey => ProjectKey + "SecretKey";
public static string GetPassword() => EditorPrefs.GetString(PasswordKey, string.Empty);
public static string GetSecretKey() => EditorPrefs.GetString(SecretKeyKey, string.Empty);
public static void SetPassword(string v) => EditorPrefs.SetString(PasswordKey, v ?? string.Empty);
public static void SetSecretKey(string v) => EditorPrefs.SetString(SecretKeyKey, v ?? string.Empty);
public static void Clear()
{
EditorPrefs.DeleteKey(PasswordKey);
EditorPrefs.DeleteKey(SecretKeyKey);
}
public static bool HasAll() =>
!string.IsNullOrEmpty(GetPassword()) && !string.IsNullOrEmpty(GetSecretKey());
[InitializeOnLoadMethod]
private static void RegisterRuntimeProvider()
{
FonepayConfig.EditorSecretsProvider = () => (GetPassword(), GetSecretKey());
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9b9868ef88aab4e2594c17b50c42df62

View File

@@ -0,0 +1,152 @@
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Darkmatter.Fonepay.Editor
{
public sealed class FonepaySettingsWindow : EditorWindow
{
private const string ResourcesDir = "Assets/Resources";
private const string ConfigAssetPath = "Assets/Resources/FonepayConfig.asset";
private FonepayConfigSO _config;
private SerializedObject _serialized;
private SerializedProperty _envProp, _merchantProp, _userProp;
private string _password;
private string _secretKey;
private bool _showSecrets;
private Vector2 _scroll;
[MenuItem("Tools/Darkmatter/Fonepay/Settings")]
public static void Open()
{
var w = GetWindow<FonepaySettingsWindow>("Fonepay");
w.minSize = new Vector2(420, 360);
w.Show();
}
private void OnEnable()
{
LoadOrPrepare();
_password = FonepaySecretsStore.GetPassword();
_secretKey = FonepaySecretsStore.GetSecretKey();
}
private void LoadOrPrepare()
{
_config = AssetDatabase.LoadAssetAtPath<FonepayConfigSO>(ConfigAssetPath);
if (_config != null)
{
_serialized = new SerializedObject(_config);
_envProp = _serialized.FindProperty("environment");
_merchantProp = _serialized.FindProperty("merchantCode");
_userProp = _serialized.FindProperty("username");
}
}
private void OnGUI()
{
_scroll = EditorGUILayout.BeginScrollView(_scroll);
EditorGUILayout.LabelField("Fonepay Setup", EditorStyles.boldLabel);
EditorGUILayout.HelpBox(
"Non-secret fields saved to Resources/FonepayConfig.asset (commit safe).\n" +
"Password & Secret Key saved to EditorPrefs (per-machine, never in repo).\n" +
"On player build, secrets baked into a temp Resources asset, removed after build.",
MessageType.Info);
EditorGUILayout.Space();
if (_config == null)
{
EditorGUILayout.HelpBox("No FonepayConfig asset. Click below to create.", MessageType.Warning);
if (GUILayout.Button("Create Config Asset", GUILayout.Height(28)))
CreateConfigAsset();
EditorGUILayout.EndScrollView();
return;
}
_serialized.Update();
EditorGUILayout.PropertyField(_envProp);
EditorGUILayout.PropertyField(_merchantProp);
EditorGUILayout.PropertyField(_userProp);
_serialized.ApplyModifiedProperties();
EditorGUILayout.Space(12);
EditorGUILayout.LabelField("Secrets (EditorPrefs)", EditorStyles.boldLabel);
_showSecrets = EditorGUILayout.ToggleLeft("Show secrets", _showSecrets);
_password = DrawSecret("Password", _password);
_secretKey = DrawSecret("Secret Key", _secretKey);
EditorGUILayout.Space(12);
DrawStatus();
EditorGUILayout.Space(8);
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Save", GUILayout.Height(28)))
Save();
if (GUILayout.Button("Clear Secrets", GUILayout.Height(28)))
ClearSecrets();
}
EditorGUILayout.EndScrollView();
}
private string DrawSecret(string label, string value)
{
return _showSecrets
? EditorGUILayout.TextField(label, value ?? string.Empty)
: EditorGUILayout.PasswordField(label, value ?? string.Empty);
}
private void DrawStatus()
{
var ok = !string.IsNullOrEmpty(_merchantProp.stringValue)
&& !string.IsNullOrEmpty(_userProp.stringValue)
&& !string.IsNullOrEmpty(_password)
&& !string.IsNullOrEmpty(_secretKey);
EditorGUILayout.HelpBox(
ok ? "All required fields set." : "Missing fields — fill all values then Save.",
ok ? MessageType.Info : MessageType.Warning);
}
private void Save()
{
_serialized.ApplyModifiedPropertiesWithoutUndo();
EditorUtility.SetDirty(_config);
AssetDatabase.SaveAssets();
FonepaySecretsStore.SetPassword(_password);
FonepaySecretsStore.SetSecretKey(_secretKey);
FonepayConfig.Invalidate();
ShowNotification(new GUIContent("Saved"));
}
private void ClearSecrets()
{
if (!EditorUtility.DisplayDialog("Clear Fonepay secrets",
"Remove password and secret key from EditorPrefs on this machine?",
"Clear", "Cancel"))
return;
FonepaySecretsStore.Clear();
_password = _secretKey = string.Empty;
FonepayConfig.Invalidate();
}
private void CreateConfigAsset()
{
if (!Directory.Exists(ResourcesDir))
Directory.CreateDirectory(ResourcesDir);
var so = ScriptableObject.CreateInstance<FonepayConfigSO>();
AssetDatabase.CreateAsset(so, ConfigAssetPath);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
LoadOrPrepare();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e0327216de93347279c639b786a694b2

View File

@@ -0,0 +1,31 @@
using UnityEditor;
namespace Darkmatter.Fonepay.Editor
{
[InitializeOnLoad]
internal static class FonepayStartupCheck
{
private const string SessionFlag = "Darkmatter.Fonepay.StartupChecked";
private const string ConfigAssetPath = "Assets/Resources/FonepayConfig.asset";
static FonepayStartupCheck()
{
EditorApplication.delayCall += RunOnce;
}
private static void RunOnce()
{
if (SessionState.GetBool(SessionFlag, false)) return;
SessionState.SetBool(SessionFlag, true);
var so = AssetDatabase.LoadAssetAtPath<FonepayConfigSO>(ConfigAssetPath);
var hasConfig = so != null
&& !string.IsNullOrEmpty(so.MerchantCode)
&& !string.IsNullOrEmpty(so.Username);
var hasSecrets = FonepaySecretsStore.HasAll();
if (!hasConfig || !hasSecrets)
FonepaySettingsWindow.Open();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f3b5a436eccc14d9d889ed58ec3b0682

View File

@@ -0,0 +1 @@
Use this file to describe your package's features.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 648fc16b27f0044b187c596f573898ca
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8fedf1a029592467d8f26d6c8b7f60f8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cfc7d75f72cd74bfeb9c54fc8c8675bc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,156 @@
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;
namespace Darkmatter.Fonepay
{
/// <summary>
/// HTTP layer. Auto-injects merchantCode/username/password from FonepayConfigSO and
/// computes the HMAC SHA-512 dataValidation before each request. Callers never set
/// credentials on request structs.
/// </summary>
internal sealed class FonepayApiClient
{
private const string QrPath = "merchant/merchantDetailsForThirdParty/thirdPartyDynamicQrDownload";
private const string StatusPath = "merchant/merchantDetailsForThirdParty/thirdPartyDynamicQrGetStatus";
private const string TaxRefundPath = "merchant/merchantDetailsForThirdParty/taxRefund";
private readonly FonepayConfigSO _config;
private readonly HmacSha512Signer _signer;
internal FonepayApiClient(FonepayConfigSO config, HmacSha512Signer signer)
{
_config = config ?? throw new ArgumentNullException(nameof(config));
_signer = signer ?? throw new ArgumentNullException(nameof(signer));
}
// ── public API ────────────────────────────────────────────────────
internal Task<QrResponse> PostQRAsync(QrRequest request, CancellationToken ct)
{
var amountStr = request.amount.ToString("0.00", CultureInfo.InvariantCulture);
var payload = new QrRequestPayload
{
amount = request.amount,
prn = request.prn,
remarks1 = request.remarks1,
remarks2 = request.remarks2,
pm = request.pm,
merchantCode = _config.MerchantCode,
username = _config.Username,
password = _config.GetPassword(),
dataValidation = _signer.SignQrRequest(
amountStr, request.prn, _config.MerchantCode,
request.remarks1, request.remarks2),
};
return SendPostAsync<QrResponse>(QrPath, payload, ct);
}
internal Task<QrResponse> GetStatusAsync(string prn, CancellationToken ct)
{
var sig = _signer.SignStatusCheck(prn, _config.MerchantCode);
var url = $"{_config.ResolveBaseUrl()}{StatusPath}" +
$"?prn={UnityWebRequest.EscapeURL(prn)}" +
$"&merchantCode={UnityWebRequest.EscapeURL(_config.MerchantCode)}" +
$"&dataValidation={UnityWebRequest.EscapeURL(sig)}" +
$"&username={UnityWebRequest.EscapeURL(_config.Username)}" +
$"&password={UnityWebRequest.EscapeURL(_config.GetPassword())}";
return SendAsync<QrResponse>(url, UnityWebRequest.kHttpVerbGET, null, ct);
}
internal Task<TaxRefundResponse> PostTaxRefundAsync(TaxRefundRequest r, CancellationToken ct)
{
var invoiceDate = r.invoiceDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
var amountStr = r.transactionAmount.ToString("0.00", CultureInfo.InvariantCulture);
var payload = new TaxRefundRequestPayload
{
fonepayTraceId = r.fonepayTraceId,
merchantPRN = r.merchantPRN,
invoiceNumber = r.invoiceNumber,
invoiceDate = invoiceDate,
transactionAmount = r.transactionAmount,
merchantCode = _config.MerchantCode,
username = _config.Username,
password = _config.GetPassword(),
dataValidation = _signer.SignTaxRefund(
r.fonepayTraceId, r.merchantPRN, r.invoiceNumber,
invoiceDate, amountStr, _config.MerchantCode),
};
return SendPostAsync<TaxRefundResponse>(TaxRefundPath, payload, ct);
}
// ── transport ─────────────────────────────────────────────────────
private Task<T> SendPostAsync<T>(string relativePath, object body, CancellationToken ct)
{
var url = _config.ResolveBaseUrl() + relativePath;
var json = JsonUtility.ToJson(body);
return SendAsync<T>(url, UnityWebRequest.kHttpVerbPOST, json, ct);
}
private static Task<T> SendAsync<T>(string url, string method, string jsonBody, CancellationToken ct)
{
var tcs = new TaskCompletionSource<T>(TaskCreationOptions.RunContinuationsAsynchronously);
var req = new UnityWebRequest(url, method)
{
downloadHandler = new DownloadHandlerBuffer(),
};
if (!string.IsNullOrEmpty(jsonBody))
{
req.uploadHandler = new UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(jsonBody));
req.SetRequestHeader("Content-Type", "application/json");
}
req.SetRequestHeader("Accept", "application/json");
CancellationTokenRegistration reg = default;
if (ct.CanBeCanceled)
reg = ct.Register(() => { try { req.Abort(); } catch { /* ignored */ } });
var op = req.SendWebRequest();
op.completed += _ =>
{
try
{
if (ct.IsCancellationRequested)
{
tcs.TrySetCanceled(ct);
return;
}
#if UNITY_2020_2_OR_NEWER
var failed = req.result != UnityWebRequest.Result.Success;
#else
var failed = req.isHttpError || req.isNetworkError;
#endif
if (failed)
{
tcs.TrySetException(new FonepayError(
(int)req.responseCode,
$"HTTP {(int)req.responseCode} {req.error}: {req.downloadHandler?.text}",
url));
return;
}
var text = req.downloadHandler.text ?? string.Empty;
T result;
try { result = JsonUtility.FromJson<T>(text); }
catch (Exception e)
{
tcs.TrySetException(new FonepayError(0,
$"JSON parse failed: {e.Message}. Body: {text}", url));
return;
}
tcs.TrySetResult(result);
}
finally
{
reg.Dispose();
req.Dispose();
}
};
return tcs.Task;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3dfb04f3804724b2d92e02816ddc53f2

View File

@@ -0,0 +1,19 @@
using UnityEngine;
namespace Darkmatter.Fonepay
{
public class FonepayWebsocketClient : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 58200a692447f4f10a39df731fa8a521

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bae1e38d737bf4e26ac9a9e3c76f6b25
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
using System.Threading.Tasks;
namespace Darkmatter.Fonepay
{
#if UNITASK_SUPPORT
using Cysharp.Threading.Tasks;
public readonly struct FonepayAsync<T>
{
private readonly UniTask<T> _task;
internal FonepayAsync(UniTask<T> task) => _task = task;
// UniTask<T>.Awaiter is a public named type — no problem
public UniTask<T>.Awaiter GetAwaiter() => _task.GetAwaiter();
}
public readonly struct FonepayAsync
{
private readonly UniTask _task;
internal FonepayAsync(UniTask task) => _task = task;
public UniTask.Awaiter GetAwaiter() => _task.GetAwaiter();
}
#else
// Unity 2023.1+ path — Awaitable<T>.GetAwaiter() return type is internal,
// so we store Task<T> and convert lazily via an async wrapper.
// The wrapper's return type is inferred — we never name the awaiter.
public readonly struct FonepayAsync<T>
{
private readonly System.Threading.Tasks.Task<T> _task;
internal FonepayAsync(System.Threading.Tasks.Task<T> task) => _task = task;
// Return type inferred from the async method — compiler handles it
public System.Runtime.CompilerServices.TaskAwaiter<T> GetAwaiter()
=> _task.GetAwaiter();
}
public readonly struct FonepayAsync
{
private readonly System.Threading.Tasks.Task _task;
internal FonepayAsync(System.Threading.Tasks.Task task) => _task = task;
public System.Runtime.CompilerServices.TaskAwaiter GetAwaiter()
=> _task.GetAwaiter();
}
#endif
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e222c5804d46c4c138b5a413587344f4

View File

@@ -0,0 +1,27 @@
using System.Threading;
using System.Threading.Tasks;
#if UNITASK_SUPPORT
using Cysharp.Threading.Tasks;
#endif
namespace Darkmatter.Fonepay
{
internal static class FonepayAsyncBridge
{
#if UNITASK_SUPPORT
internal static FonepayAsync<T> Wrap<T>(Task<T> task, CancellationToken ct = default)
=> new FonepayAsync<T>(task.AsUniTask().AttachExternalCancellation(ct));
internal static FonepayAsync Wrap(Task task, CancellationToken ct = default)
=> new FonepayAsync(task.AsUniTask().AttachExternalCancellation(ct));
#else
// Task is already awaitable — wrap directly, no Awaitable needed
internal static FonepayAsync<T> Wrap<T>(Task<T> task, CancellationToken ct = default)
=> new FonepayAsync<T>(task);
internal static FonepayAsync Wrap(Task task, CancellationToken ct = default)
=> new FonepayAsync(task);
#endif
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 778cc7d92ed1645c195685b07ca02ee1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a5ca890ee6ddf43ebb0a47f228ffe838
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEngine;
namespace Darkmatter.Fonepay
{
/// <summary>
/// Transient ScriptableObject containing baked secrets for player builds.
/// Created by FonepayBuildSecretsInjector before build, deleted after build completes.
/// Never commit this asset — added to .gitignore by the settings window.
/// </summary>
public class FonepayBakedSecrets : ScriptableObject
{
public string password;
public string secretKey;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f6baad01d5e6740bfb8abc8faadfe594

View File

@@ -0,0 +1,51 @@
using System.Threading;
using System.Threading.Tasks;
namespace Darkmatter.Fonepay
{
/// <summary>
/// Public facade. Auto-loads config + secrets via <see cref="FonepayConfig.Load"/>.
/// Caller never touches credentials.
/// </summary>
public sealed class FonepayClient
{
private readonly FonepayApiClient _api;
public FonepayClient() : this(FonepayConfig.Load())
{
}
public FonepayClient(FonepayConfigSO config)
{
var signer = new HmacSha512Signer(config.GetSecretKey());
_api = new FonepayApiClient(config, signer);
}
/// <summary>
/// Request a new QR code. The returned URL is valid for 15 minutes. Call GetStatusAsync() to check if the QR code has been paid.
/// </summary>
/// <param name="req"></param>
/// <param name="ct"></param>
/// <returns></returns>
public Task<QrResponse> PostQRAsync(QrRequest req, CancellationToken ct = default)
=> _api.PostQRAsync(req, ct);
/// <summary>
/// Check if a QR code has been paid. Call after PostQRAsync() to check if the QR code has been paid. Returns "PAID" if successful, "UNPAID" if not yet paid, or an error message if the PRN is invalid or expired.
/// </summary>
/// <param name="prn"></param>
/// <param name="ct"></param>
/// <returns></returns>
public Task<QrResponse> GetStatusAsync(string prn, CancellationToken ct = default)
=> _api.GetStatusAsync(prn, ct);
/// <summary>
/// Request a tax refund. Returns "REFUND_SUCCESS" if successful, or an error message if the PRN is invalid, expired, or not eligible for refund.
/// </summary>
/// <param name="req"></param>
/// <param name="ct"></param>
/// <returns></returns>
public Task<TaxRefundResponse> PostTaxRefundAsync(TaxRefundRequest req, CancellationToken ct = default)
=> _api.PostTaxRefundAsync(req, ct);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e1ab3a2c9f1aa4d5aa87b6305323a1fc

View File

@@ -0,0 +1,61 @@
using System;
using UnityEngine;
namespace Darkmatter.Fonepay
{
/// <summary>
/// Static accessor. Returns ready-to-use <see cref="FonepayConfigSO"/> with credentials injected.
/// Editor: secrets supplied via <see cref="EditorSecretsProvider"/> hook (set by FonepaySecretsStore on editor load).
/// Builds: secrets read from <see cref="FonepayBakedSecrets"/> resource (written by build preprocessor, removed after build).
/// </summary>
public static class FonepayConfig
{
private const string ResourcePath = "FonepayConfig";
private const string BakedSecretsResource = "FonepayBakedSecrets";
public static Func<(string password, string secretKey)> EditorSecretsProvider;
private static FonepayConfigSO _cached;
public static FonepayConfigSO Load()
{
if (_cached != null) return _cached;
var so = Resources.Load<FonepayConfigSO>(ResourcePath);
if (so == null)
throw new FonepayError(0,
"FonepayConfig asset missing. Open Tools > Fonepay > Settings to create it.",
"FonepayConfig.Load");
string password = null;
string secretKey = null;
if (Application.isEditor && EditorSecretsProvider != null)
{
var creds = EditorSecretsProvider();
password = creds.password;
secretKey = creds.secretKey;
}
else
{
var baked = Resources.Load<FonepayBakedSecrets>(BakedSecretsResource);
if (baked != null)
{
password = baked.password;
secretKey = baked.secretKey;
}
}
if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(secretKey))
throw new FonepayError(0,
"Fonepay credentials missing. Open Tools > Fonepay > Settings.",
"FonepayConfig.Load");
so.SetCredentials(password, secretKey);
_cached = so;
return so;
}
public static void Invalidate() => _cached = null;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3617f631547ae4b10a0f8f634751c61f

View File

@@ -0,0 +1,59 @@
using System;
using UnityEngine;
namespace Darkmatter.Fonepay
{
// <summary>
// ScriptableObject. Holds non-secret config fields serialised to disk. Secret key and password are injected at runtime only — never serialised.
// </summary>
public class FonepayConfigSO : ScriptableObject
{
[SerializeField] private FonepayEnvironment environment;
[SerializeField] private string merchantCode;
[SerializeField] private string username;
private string _password;
private string _secretKey;
private bool _credentialsSet;
// ── public read access ────────────────────────────────────────────
public FonepayEnvironment Environment => environment;
public string MerchantCode => merchantCode;
public string Username => username;
// ── runtime credential injection (called by FonepayPlayModeInjector) ──
public void SetCredentials(string password, string secretKey)
{
_password = password;
_secretKey = secretKey;
_credentialsSet = true;
}
private const string FonepayLiveEndpoint = "https://merchantapi.fonepay.com/api/";
private const string FonepayDevEndpoint = "https://dev-merchantapi.fonepay.com/api/";
// ── used internally by FonepayApiClient and HmacSha512Signer ─────
internal string GetPassword() => GuardCredentials(_password);
internal string GetSecretKey() => GuardCredentials(_secretKey);
// ── URL resolution ────────────────────────────────────────────────
public string ResolveBaseUrl() => environment == FonepayEnvironment.Live
? FonepayLiveEndpoint
: FonepayDevEndpoint;
// ── guards ────────────────────────────────────────────────────────
private string GuardCredentials(string value)
{
if (!_credentialsSet)
throw new FonepayError(0,
"Credentials not set. Call SetCredentials() before using FonepayClient.",
"FonepayConfig.SetCredentials");
return value;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ba80c86a04c584a649c6d31e8f10adad

View File

@@ -0,0 +1,8 @@
namespace Darkmatter.Fonepay
{
public enum FonepayEnvironment
{
Dev,
Live
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c92e6dd7cf3a84c1e85fa2f19741794e

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 74b5b5675851d481a89f7c6136b159d7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using System.Security.Cryptography;
using System.Text;
internal sealed class HmacSha512Signer
{
private readonly byte[] _keyBytes;
internal HmacSha512Signer(string secretKey)
{
_keyBytes = Encoding.UTF8.GetBytes(secretKey);
}
internal string SignQrRequest(
string amount, string prn, string merchantCode,
string remarks1, string remarks2)
=> Compute($"{amount},{prn},{merchantCode},{remarks1},{remarks2}");
internal string SignQrRequestWithTax(
string amount, string prn, string merchantCode,
string remarks1, string remarks2,
string taxAmount, string taxRefund)
=> Compute($"{amount},{prn},{merchantCode},{remarks1},{remarks2},{taxAmount},{taxRefund}");
internal string SignStatusCheck(string prn, string merchantCode)
=> Compute($"{prn},{merchantCode}");
internal string SignTaxRefund(
string fonepayTraceId, string merchantPrn,
string invoiceNumber, string invoiceDate,
string transactionAmount, string merchantCode)
=> Compute($"{fonepayTraceId},{merchantPrn},{invoiceNumber},{invoiceDate},{transactionAmount},{merchantCode}");
private string Compute(string message)
{
using var hmac = new HMACSHA512(_keyBytes);
byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(message));
return BytesToHexLower(hash);
}
private static string BytesToHexLower(byte[] bytes)
{
var sb = new StringBuilder(bytes.Length * 2);
foreach (byte b in bytes)
sb.Append(b.ToString("x2"));
return sb.ToString();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 93fb47df723f74372b0fa6e228e4dd73

View File

@@ -0,0 +1,22 @@
{
"name": "Darkmatter.FonepayUnity",
"rootNamespace": "Darkmatter.Fonepay",
"references": [
"UniTask"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.cysharp.unitask",
"expression": "",
"define": "UNITASK_SUPPORT"
}
],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: de841957485ec4208a629f66aa4b24c9
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c216a6be596b84649a99f22d45ca0ce5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using System;
namespace Darkmatter.Fonepay
{
public sealed class FonepayError : Exception
{
public int ErrorCode { get; }
public FonepayError(int errorCode, string message,
string docs)
{
ErrorCode = errorCode;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 46adc238f3552442bad6f68d9b2ee68a

View File

@@ -0,0 +1,32 @@
using System;
namespace Darkmatter.Fonepay
{
/// <summary>
/// User-facing QR request. Credentials (merchantCode/username/password) and the
/// HMAC dataValidation are injected by FonepayApiClient at send time.
/// </summary>
[Serializable]
public struct QrRequest
{
public float amount;
public string prn;
public string remarks1;
public string remarks2;
public string pm;
}
[Serializable]
internal struct QrRequestPayload
{
public float amount;
public string prn;
public string remarks1;
public string remarks2;
public string pm;
public string merchantCode;
public string dataValidation;
public string username;
public string password;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 255c2e13d0ed54987904cd65a5349d29

View File

@@ -0,0 +1,15 @@
using System;
namespace Darkmatter.Fonepay
{
[Serializable]
public struct QrResponse
{
public string message;
public string qrMessage;
public string status;
public int statusCode;
public bool success;
public string thirdpartyQrWebSocketUrl;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 405247a27c684f08ab11d6ea33d250c0
timeCreated: 1778138521

View File

@@ -0,0 +1,32 @@
using System;
namespace Darkmatter.Fonepay
{
/// <summary>
/// User-facing tax refund request. Credentials and HMAC dataValidation are
/// injected by FonepayApiClient at send time.
/// </summary>
[Serializable]
public struct TaxRefundRequest
{
public string fonepayTraceId;
public string merchantPRN;
public string invoiceNumber;
public DateTime invoiceDate;
public float transactionAmount;
}
[Serializable]
internal struct TaxRefundRequestPayload
{
public string fonepayTraceId;
public string merchantPRN;
public string invoiceNumber;
public string invoiceDate;
public float transactionAmount;
public string merchantCode;
public string dataValidation;
public string username;
public string password;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 328f1e46b5a941bbbf5c0e8294fc9c34
timeCreated: 1778140313

View File

@@ -0,0 +1,9 @@
namespace Darkmatter.Fonepay
{
public struct TaxRefundResponse
{
public string fonepayTraceId;
public string message;
public bool success;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ccdcd51d0dc843eabdb25aa3312bd91a
timeCreated: 1778140771

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 47a1e64b2c84a4238b5cc62aa4c8fb80
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
using System;
namespace Darkmatter.Fonepay
{
public static partial class FonepayQRGenerator
{
// [version-1][eccLevel] = (totalCodewords, ecCodewordsPerBlock, blocks)
static readonly (int total, int ecPerBlock, int blocks)[,] _caps =
{
{ (19, 7, 1), (16, 10, 1), (13, 13, 1), (9, 17, 1) },
{ (34, 10, 1), (28, 16, 1), (22, 22, 1), (16, 28, 1) },
{ (55, 15, 1), (44, 26, 1), (34, 18, 2), (26, 22, 2) },
{ (80, 20, 2), (64, 18, 2), (48, 26, 4), (36, 16, 4) },
{ (108, 26, 2), (86, 24, 2), (62, 18, 2), (46, 22, 2) },
{ (136, 18, 4), (108, 16, 4), (76, 24, 4), (60, 28, 4) },
{ (156, 20, 4), (124, 18, 4), (88, 18, 6), (66, 26, 4) },
{ (194, 24, 4), (154, 22, 4), (110, 22, 6), (86, 26, 4) },
{ (232, 30, 4), (182, 22, 5), (132, 20, 8), (100, 24, 4) },
{ (274, 18, 6), (216, 26, 6), (154, 24, 8), (122, 28, 6) },
};
static int DataCodewords(int ver, EccLevel ecc)
{
var (total, ecPer, blks) = _caps[ver - 1, (int)ecc];
return total - ecPer * blks;
}
static (int version, (int total, int ecPerBlock, int blocks) ecBlocks)
ChooseVersion(int byteLen, EccLevel ecc)
{
for (int v = 1; v <= 10; v++)
{
int dc = DataCodewords(v, ecc);
if (dc >= byteLen + 2)
return (v, _caps[v - 1, (int)ecc]);
}
throw new Exception($"Data too large for versions 1-10 (byte mode, ecc={ecc})");
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a611e576dae8b4ff6b15c314c1246cf1

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
namespace Darkmatter.Fonepay
{
public static partial class FonepayQRGenerator
{
static byte[] BuildCodewords(byte[] data, int version, EccLevel ecc,
(int total, int ecPerBlock, int blocks) ecBlocks)
{
var bits = new List<bool>();
bits.AddRange(new[] { false, true, false, false }); // byte mode
int len = data.Length;
for (int i = 7; i >= 0; i--) bits.Add(((len >> i) & 1) == 1);
foreach (byte b in data)
for (int i = 7; i >= 0; i--)
bits.Add(((b >> i) & 1) == 1);
int dcBytes = DataCodewords(version, ecc);
int targetBits = dcBytes * 8;
for (int i = 0; i < 4 && bits.Count < targetBits; i++) bits.Add(false);
while (bits.Count % 8 != 0) bits.Add(false);
bool[] padA = { true, true, true, false, true, true, false, false };
bool[] padB = { false, false, false, true, false, false, false, true };
int pi = 0;
while (bits.Count < targetBits)
{
bits.AddRange(pi % 2 == 0 ? padA : padB);
pi++;
}
byte[] dc = new byte[dcBytes];
for (int i = 0; i < dcBytes; i++)
for (int b = 0; b < 8; b++)
if (bits[i * 8 + b])
dc[i] |= (byte)(1 << (7 - b));
int blocks = ecBlocks.blocks;
int ecPer = ecBlocks.ecPerBlock;
int blockSize = dcBytes / blocks;
byte[][] dcBlocks = new byte[blocks][];
byte[][] ecBlocksArr = new byte[blocks][];
for (int i = 0; i < blocks; i++)
{
dcBlocks[i] = new byte[blockSize];
Array.Copy(dc, i * blockSize, dcBlocks[i], 0, blockSize);
ecBlocksArr[i] = ReedSolomon(dcBlocks[i], ecPer);
}
var result = new List<byte>();
for (int i = 0; i < blockSize; i++)
for (int b = 0; b < blocks; b++)
result.Add(dcBlocks[b][i]);
for (int i = 0; i < ecPer; i++)
for (int b = 0; b < blocks; b++)
result.Add(ecBlocksArr[b][i]);
return result.ToArray();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e67574ccbe68944928d706bd99d785ca

View File

@@ -0,0 +1,234 @@
using System;
namespace Darkmatter.Fonepay
{
public static partial class FonepayQRGenerator
{
static bool[,] BuildMatrix(int version, byte[] codewords)
{
int size = version * 4 + 17;
var matrix = new bool[size, size];
var reserved = new bool[size, size];
PlaceFinder(matrix, reserved, 0, 0);
PlaceFinder(matrix, reserved, 0, size - 7);
PlaceFinder(matrix, reserved, size - 7, 0);
PlaceTiming(matrix, reserved, size);
PlaceDarkModule(matrix, reserved, version);
if (version >= 2) PlaceAlignment(matrix, reserved, version);
ReserveFormat(reserved, size);
PlaceData(matrix, reserved, codewords, size);
int bestPenalty = int.MaxValue;
bool[,] bestMatrix = null;
for (int m = 0; m < 8; m++)
{
var candidate = (bool[,])matrix.Clone();
ApplyMask(candidate, reserved, m, size);
ApplyFormatInfo(candidate, reserved, 1, m, size);
int penalty = CalcPenalty(candidate, size);
if (penalty < bestPenalty)
{
bestPenalty = penalty;
bestMatrix = (bool[,])candidate.Clone();
}
}
return bestMatrix;
}
static void PlaceFinder(bool[,] m, bool[,] r, int row, int col)
{
for (int dr = -1; dr <= 7; dr++)
for (int dc = -1; dc <= 7; dc++)
{
int rr = row + dr, cc = col + dc;
if (rr < 0 || cc < 0 || rr >= m.GetLength(0) || cc >= m.GetLength(1)) continue;
r[rr, cc] = true;
bool inOuter = dr >= 0 && dr <= 6 && dc >= 0 && dc <= 6;
bool inBorder = (dr == 0 || dr == 6 || dc == 0 || dc == 6) && inOuter;
bool inInner = dr >= 2 && dr <= 4 && dc >= 2 && dc <= 4;
m[rr, cc] = !(dr == -1 || dc == -1 || dr == 7 || dc == 7) && (inBorder || inInner);
}
}
static void PlaceTiming(bool[,] m, bool[,] r, int size)
{
for (int i = 8; i < size - 8; i++)
{
bool v = i % 2 == 0;
m[6, i] = v; r[6, i] = true;
m[i, 6] = v; r[i, 6] = true;
}
}
static void PlaceDarkModule(bool[,] m, bool[,] r, int ver)
{
int row = ver * 4 + 9;
m[row, 8] = true;
r[row, 8] = true;
}
static readonly int[][] _alignCenters =
{
new int[] { },
new[] { 6, 18 },
new[] { 6, 22 },
new[] { 6, 26 },
new[] { 6, 30 },
new[] { 6, 34 },
new[] { 6, 22, 38 },
new[] { 6, 24, 42 },
new[] { 6, 26, 46 },
new[] { 6, 28, 50 },
};
static void PlaceAlignment(bool[,] m, bool[,] r, int version)
{
int[] centers = _alignCenters[version - 1];
foreach (int row in centers)
foreach (int col in centers)
{
if (r[row, col]) continue;
for (int dr = -2; dr <= 2; dr++)
for (int dc = -2; dc <= 2; dc++)
{
bool dark = Math.Abs(dr) == 2 || Math.Abs(dc) == 2 || (dr == 0 && dc == 0);
m[row + dr, col + dc] = dark;
r[row + dr, col + dc] = true;
}
}
}
static void ReserveFormat(bool[,] r, int size)
{
for (int i = 0; i <= 8; i++)
{
r[8, i] = true;
r[i, 8] = true;
}
for (int i = size - 8; i < size; i++)
{
r[8, i] = true;
r[i, 8] = true;
}
}
static void PlaceData(bool[,] m, bool[,] r, byte[] cw, int size)
{
int cwIdx = 0, bitIdx = 7;
bool upward = true;
int col = size - 1;
while (col > 0)
{
if (col == 6) col--;
for (int rowStep = 0; rowStep < size; rowStep++)
{
int row = upward ? size - 1 - rowStep : rowStep;
for (int c = 0; c < 2; c++)
{
int cc = col - c;
if (r[row, cc]) continue;
bool bit = cwIdx < cw.Length && ((cw[cwIdx] >> bitIdx) & 1) == 1;
m[row, cc] = bit;
if (--bitIdx < 0)
{
bitIdx = 7;
cwIdx++;
}
}
}
upward = !upward;
col -= 2;
}
}
static void ApplyMask(bool[,] m, bool[,] r, int mask, int size)
{
for (int row = 0; row < size; row++)
for (int col = 0; col < size; col++)
{
if (r[row, col]) continue;
bool flip = mask switch
{
0 => (row + col) % 2 == 0,
1 => row % 2 == 0,
2 => col % 3 == 0,
3 => (row + col) % 3 == 0,
4 => (row / 2 + col / 3) % 2 == 0,
5 => row * col % 2 + row * col % 3 == 0,
6 => (row * col % 2 + row * col % 3) % 2 == 0,
7 => ((row + col) % 2 + row * col % 3) % 2 == 0,
_ => false
};
if (flip) m[row, col] ^= true;
}
}
static readonly ushort[] _formatL = { 0x77C4, 0x72F3, 0x7DAA, 0x789D, 0x662F, 0x6318, 0x6C41, 0x6976 };
static readonly ushort[] _formatM = { 0x5412, 0x5125, 0x5E7C, 0x5B4B, 0x45F9, 0x40CE, 0x4F97, 0x4AA0 };
static readonly ushort[] _formatQ = { 0x355F, 0x3068, 0x3F31, 0x3A06, 0x24B4, 0x2183, 0x2EDA, 0x2BED };
static readonly ushort[] _formatH = { 0x1689, 0x13BE, 0x1CE7, 0x19D0, 0x0762, 0x0255, 0x0D0C, 0x083B };
static void ApplyFormatInfo(bool[,] m, bool[,] r, int eccIndex, int mask, int size)
{
ushort[] table = eccIndex switch { 0 => _formatM, 1 => _formatL, 2 => _formatH, _ => _formatQ };
ushort fmt = table[mask];
int[] seq = { 0, 1, 2, 3, 4, 5, 7, 8 };
for (int i = 0; i < 8; i++)
{
bool bit = ((fmt >> (14 - i)) & 1) == 1;
m[8, seq[i]] = bit;
m[seq[i < 6 ? i : i + 1 < 8 ? i : i], 8] = bit;
}
for (int i = 0; i < 7; i++)
{
bool bit = ((fmt >> i) & 1) == 1;
m[size - 1 - i, 8] = bit;
}
for (int i = 7; i < 15; i++)
{
bool bit = ((fmt >> i) & 1) == 1;
m[8, size - 15 + i] = bit;
}
}
static int CalcPenalty(bool[,] m, int size)
{
int p = 0;
for (int r = 0; r < size; r++)
{
int run = 1;
for (int c = 1; c < size; c++)
{
if (m[r, c] == m[r, c - 1])
{
run++;
if (run == 5) p += 3;
else if (run > 5) p++;
}
else run = 1;
}
run = 1;
for (int c = 1; c < size; c++)
{
if (m[c, r] == m[c - 1, r])
{
run++;
if (run == 5) p += 3;
else if (run > 5) p++;
}
else run = 1;
}
}
for (int r = 0; r < size - 1; r++)
for (int c = 0; c < size - 1; c++)
if (m[r, c] == m[r, c + 1] && m[r, c] == m[r + 1, c] && m[r, c] == m[r + 1, c + 1])
p += 3;
return p;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6510d029572264a5b8aea6d31e302686

View File

@@ -0,0 +1,67 @@
using System;
namespace Darkmatter.Fonepay
{
public static partial class FonepayQRGenerator
{
static readonly byte[] _exp = new byte[512];
static readonly byte[] _log = new byte[256];
static FonepayQRGenerator()
{
int x = 1;
for (int i = 0; i < 255; i++)
{
_exp[i] = (byte)x;
_log[x] = (byte)i;
x <<= 1;
if (x >= 256) x ^= 0x11d;
}
for (int i = 255; i < 512; i++) _exp[i] = _exp[i - 255];
}
static byte GfMul(byte a, byte b)
{
if (a == 0 || b == 0) return 0;
return _exp[(_log[a] + _log[b]) % 255];
}
static byte GfPow(int b, int e) => _exp[(_log[(byte)b] * e) % 255];
static byte[] ReedSolomon(byte[] data, int ecCount)
{
byte[] gen = RsGenerator(ecCount);
byte[] msg = new byte[data.Length + ecCount];
Array.Copy(data, msg, data.Length);
for (int i = 0; i < data.Length; i++)
{
byte coef = msg[i];
if (coef == 0) continue;
for (int j = 1; j < gen.Length; j++)
msg[i + j] ^= GfMul(gen[j], coef);
}
byte[] ec = new byte[ecCount];
Array.Copy(msg, data.Length, ec, 0, ecCount);
return ec;
}
static byte[] RsGenerator(int degree)
{
byte[] g = { 1 };
for (int i = 0; i < degree; i++)
{
byte[] ng = new byte[g.Length + 1];
byte root = GfPow(2, i);
for (int j = 0; j < g.Length; j++)
{
ng[j] ^= GfMul(g[j], root);
ng[j + 1] ^= g[j];
}
g = ng;
}
return g;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 049bdafac777b4e58bafafb2224e88a8

View File

@@ -0,0 +1,64 @@
using UnityEngine;
namespace Darkmatter.Fonepay
{
/// <summary>
/// Pure C# QR Code generator. Byte mode, ECC L/M/Q/H, versions 110.
/// </summary>
public static partial class FonepayQRGenerator
{
public enum EccLevel { L, M, Q, H }
public static Texture2D GenerateTexture(string text, int pixelSize = 10,
EccLevel ecc = EccLevel.M, Color? darkColor = null, Color? lightColor = null)
{
bool[,] matrix = GenerateMatrix(text, ecc);
int size = matrix.GetLength(0);
int texSize = size * pixelSize;
var tex = new Texture2D(texSize, texSize, TextureFormat.RGBA32, false)
{
filterMode = FilterMode.Point,
wrapMode = TextureWrapMode.Clamp
};
Color dark = darkColor ?? Color.black;
Color light = lightColor ?? Color.white;
for (int row = 0; row < size; row++)
for (int col = 0; col < size; col++)
{
Color c = matrix[row, col] ? dark : light;
for (int py = 0; py < pixelSize; py++)
for (int px = 0; px < pixelSize; px++)
tex.SetPixel(col * pixelSize + px,
(size - 1 - row) * pixelSize + py, c);
}
tex.Apply();
return tex;
}
public static Sprite GenerateSprite(string text, int pixelSize = 10,
EccLevel ecc = EccLevel.M, Color? darkColor = null, Color? lightColor = null,
float pixelsPerUnit = 100f)
{
var tex = GenerateTexture(text, pixelSize, ecc, darkColor, lightColor);
var sprite = Sprite.Create(tex,
new Rect(0, 0, tex.width, tex.height),
new Vector2(0.5f, 0.5f),
pixelsPerUnit,
0, SpriteMeshType.FullRect);
sprite.name = "FonepayQR";
return sprite;
}
public static bool[,] GenerateMatrix(string text, EccLevel ecc = EccLevel.M)
{
byte[] data = System.Text.Encoding.UTF8.GetBytes(text);
var (version, ecBlocks) = ChooseVersion(data.Length, ecc);
byte[] codewords = BuildCodewords(data, version, ecc, ecBlocks);
return BuildMatrix(version, codewords);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 926e00b59f70b418bbf937c11a1c8494

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 111b87cef6134401aa05813da47709aa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a65b4dbd6e610485fae19b0acddf3890
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,4 @@
{
"displayName":"Example Sample",
"description": "Replace this string with your own description of the sample. Delete the Samples folder if not needed."
}

View File

@@ -0,0 +1,28 @@
// -----------------------------------------------------------------------------
//
// Use this sample example C# file to develop samples to guide usage of APIs
// in your package.
//
// -----------------------------------------------------------------------------
namespace Voidbotz.Fonepayunity
{
/// <summary>
/// Provide a general description of the public class.
/// </summary>
/// <remarks>
/// Packages require XmlDoc documentation for ALL Package APIs.
/// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments
/// </remarks>
public class MyPublicSampleExampleClass
{
/// <summary>
/// Provide a description of what this public method does.
/// </summary>
public void CountThingsAndDoStuffAndOutputIt()
{
var result = new MyPublicRuntimeExampleClass().CountThingsAndDoStuff(1, 2, false);
Debug.Log("Call CountThingsAndDoStuffAndOutputIt returns " + result);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d76a32b915c2d4f23bfe2390d12ee672

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3287b987b9ae04cc8af7bb76a1fafd21
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 98341f79b8169426c8edbc4469715037
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,29 @@
using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
namespace Voidbotz.Fonepayunity.Editor.Tests
{
class EditorExampleTest
{
[Test]
public void EditorSampleTestSimplePasses()
{
// Use the Assert class to test conditions.
}
// A UnityTest behaves like a coroutine in PlayMode
// and allows you to yield null to skip a frame in EditMode
[UnityTest]
public IEnumerator EditorSampleTestWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// yield to skip a frame
yield return null;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 382d5d15b2d9e4789aac53c1b86194b0

View File

@@ -0,0 +1,14 @@
{
"name": "Voidbotz.Fonepayunity.Editor.Tests",
"references": [
"Voidbotz.Fonepayunity.Editor",
"Voidbotz.Fonepayunity"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2a4ef70a61be54ea6b8ada95c5e2743c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6639ec7313a77493fb517eb322745684
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
namespace Voidbotz.Fonepayunity.Tests
{
class RuntimeExampleTest
{
[Test]
public void PlayModeSampleTestSimplePasses()
{
// Use the Assert class to test conditions.
}
// A UnityTest behaves like a coroutine in PlayMode
// and allows you to yield null to skip a frame in EditMode
[UnityTest]
public IEnumerator PlayModeSampleTestWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// yield to skip a frame
yield return null;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e9d969af7bf1a46f0a0c37692d7d862f

View File

@@ -0,0 +1,11 @@
{
"name": "Voidbotz.Fonepayunity.Tests",
"references": [
"Voidbotz.Fonepayunity"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": []
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5b7c0851a1002412dadc7d1c37a4cef5
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
This package contains third-party software components governed by the license(s) indicated below:
---------
Component Name: [provide component name]
License Type: [Provide license type, i.e. "MIT", "Apache 2.0"]
[Provide License Details]
---------
Component Name: [provide component name]
License Type: [Provide license type, i.e. "MIT", "Apache 2.0"]
[Provide License Details]

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6ddd2e7cbebff474c8e1bfdf019e71aa
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
{
"name": "com.voidbotz.fonepayunity",
"displayName": "Fonepay Unity",
"version": "0.1.0",
"unity": "6000.4",
"unityRelease": "5f1",
"description": "Replace this with your own description of the package. \n\nFor best results, use this text to summarize: \n\u25aa What the package does \n\u25aa How it can benefit the user \n\nNote: Special formatting characters are supported, including line breaks ('\\n') and bullets ('\\u25AA').",
"dependencies": {
"com.unity.test-framework": "1.6.0"
},
"author": {
"name": "Savya Bikram Shah",
"url": "http://www.example.com",
"email": "mail@savya.com.np"
},
"changelogUrl": "https://example.com/changelog.html",
"documentationUrl": "https://example.com/",
"licensesUrl": "https://example.com/licensing.html"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 450856927d9ed4360b654814b041ebf0
PackageManifestImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

57
Packages/manifest.json Normal file
View File

@@ -0,0 +1,57 @@
{
"dependencies": {
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
"com.unity.2d.animation": "14.0.3",
"com.unity.2d.aseprite": "4.0.1",
"com.unity.2d.psdimporter": "13.0.2",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "14.0.1",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.2d.tilemap.extras": "7.0.1",
"com.unity.2d.tooling": "2.0.1",
"com.unity.collab-proxy": "2.12.4",
"com.unity.ide.rider": "3.0.39",
"com.unity.ide.visualstudio": "2.0.27",
"com.unity.inputsystem": "1.19.0",
"com.unity.multiplayer.center": "1.0.1",
"com.unity.render-pipelines.universal": "17.4.0",
"com.unity.test-framework": "1.6.0",
"com.unity.timeline": "1.8.12",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.11",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.adaptiveperformance": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vectorgraphics": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}

575
Packages/packages-lock.json Normal file
View File

@@ -0,0 +1,575 @@
{
"dependencies": {
"com.cysharp.unitask": {
"version": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "a9e27c03d411d2fca01cc7410c24c97cd77cb539"
},
"com.unity.2d.animation": {
"version": "14.0.3",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "13.0.1",
"com.unity.2d.sprite": "1.0.0",
"com.unity.collections": "2.4.3",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.aseprite": {
"version": "4.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "13.0.1",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.mathematics": "1.2.6",
"com.unity.modules.animation": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.common": {
"version": "13.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.4",
"com.unity.2d.sprite": "1.0.0",
"com.unity.collections": "2.4.3",
"com.unity.mathematics": "1.1.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.psdimporter": {
"version": "13.0.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "13.0.1",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.sprite": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.2d.spriteshape": {
"version": "14.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "13.0.1",
"com.unity.mathematics": "1.1.0",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
}
},
"com.unity.2d.tilemap.extras": {
"version": "7.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.tilemap": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.tooling": {
"version": "2.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "13.0.1",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.29",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.12.4",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.collections": {
"version": "6.4.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.burst": "1.8.23",
"com.unity.mathematics": "1.3.2",
"com.unity.nuget.mono-cecil": "1.11.5",
"com.unity.test-framework": "1.4.6",
"com.unity.test-framework.performance": "3.0.3"
}
},
"com.unity.ext.nunit": {
"version": "2.0.5",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.ide.rider": {
"version": "3.0.39",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.27",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.33"
},
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.19.0",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.3.3",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.multiplayer.center": {
"version": "1.0.1",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.uielements": "1.0.0"
}
},
"com.unity.nuget.mono-cecil": {
"version": "1.11.6",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.core": {
"version": "17.4.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.burst": "1.8.14",
"com.unity.mathematics": "1.3.2",
"com.unity.ugui": "2.0.0",
"com.unity.collections": "2.4.3",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.render-pipelines.universal": {
"version": "17.4.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "17.4.0",
"com.unity.shadergraph": "17.4.0",
"com.unity.render-pipelines.universal-config": "17.4.0"
}
},
"com.unity.render-pipelines.universal-config": {
"version": "17.4.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "17.4.0"
}
},
"com.unity.searcher": {
"version": "4.9.4",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.shadergraph": {
"version": "17.4.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "17.4.0",
"com.unity.searcher": "4.9.3"
}
},
"com.unity.test-framework": {
"version": "1.6.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.ext.nunit": "2.0.3",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.test-framework.performance": {
"version": "3.4.0",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.33",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.8.12",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "2.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.visualscripting": {
"version": "1.9.11",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.voidbotz.fonepayunity": {
"version": "file:com.voidbotz.fonepayunity",
"depth": 0,
"source": "embedded",
"dependencies": {
"com.unity.test-framework": "1.6.0"
}
},
"com.unity.modules.accessibility": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.adaptiveperformance": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.subsystems": "1.0.0"
}
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.hierarchycore": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.hierarchycore": "1.0.0",
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vectorgraphics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}