Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f6ad3df13 | ||
|
|
cca555f3e9 | ||
|
|
4fe63fc575 |
@@ -4,6 +4,11 @@ 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.2.1] - 2026-06-16
|
||||
|
||||
### Changed
|
||||
- Maintenance release to publish the package via the UPM split pipeline. No API or runtime changes.
|
||||
|
||||
## [0.2.0] - 2026-05-07
|
||||
|
||||
### Changed
|
||||
|
||||
BIN
Samples~/.DS_Store
vendored
Normal file
BIN
Samples~/.DS_Store
vendored
Normal file
Binary file not shown.
8
Samples~/Example.meta
Normal file
8
Samples~/Example.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65d000fc5ca9742ec882f227d68c7bd4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Samples~/Example/.DS_Store
vendored
Normal file
BIN
Samples~/Example/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -30,14 +30,18 @@ namespace Darkmatter.Fonepay.Samples
|
||||
|
||||
private async UniTask InitiatePayment()
|
||||
{
|
||||
if (_payCts != null) return;
|
||||
|
||||
payButton.interactable = false;
|
||||
var fonepay = new FonepayClient();
|
||||
_payCts = CancellationTokenSource.CreateLinkedTokenSource(destroyCancellationToken);
|
||||
var cts = CancellationTokenSource.CreateLinkedTokenSource(destroyCancellationToken);
|
||||
_payCts = cts;
|
||||
|
||||
try
|
||||
{
|
||||
var qr = await fonepay.PurchaseAsync(
|
||||
new QrRequest { amount = amount, remarks1 = "sample" },
|
||||
_payCts.Token);
|
||||
cts.Token);
|
||||
|
||||
if (qr.qrCode != null)
|
||||
{
|
||||
@@ -51,7 +55,7 @@ namespace Darkmatter.Fonepay.Samples
|
||||
var payment = await fonepay.AwaitPaymentAsync(
|
||||
qr.thirdpartyQrWebSocketUrl,
|
||||
onQrVerified: v => Debug.Log($"Fonepay QR verified: {v}"),
|
||||
ct: _payCts.Token);
|
||||
ct: cts.Token);
|
||||
|
||||
Debug.Log($"Payment frame: {JsonUtility.ToJson(payment)}");
|
||||
ShowResult(payment.Outcome == PaymentOutcome.Complete);
|
||||
@@ -73,14 +77,19 @@ namespace Darkmatter.Fonepay.Samples
|
||||
}
|
||||
finally
|
||||
{
|
||||
_payCts.Dispose();
|
||||
_payCts = null;
|
||||
cts.Dispose();
|
||||
if (_payCts == cts) _payCts = null;
|
||||
if (this != null && payButton != null) payButton.interactable = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowResult(bool ok)
|
||||
{
|
||||
qrImage.gameObject.SetActive(false);
|
||||
if (qrImage != null)
|
||||
{
|
||||
qrImage.sprite = null;
|
||||
qrImage.gameObject.SetActive(false);
|
||||
}
|
||||
if (successObject != null) successObject.SetActive(ok);
|
||||
if (failedObject != null) failedObject.SetActive(!ok);
|
||||
}
|
||||
|
||||
2
Samples~/Example/SamplePayment.cs.meta
Normal file
2
Samples~/Example/SamplePayment.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d53a9483205b945d69e846f2285560bd
|
||||
1562
Samples~/Example/SampleScene.unity
Normal file
1562
Samples~/Example/SampleScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Samples~/Example/SampleScene.unity.meta
Normal file
7
Samples~/Example/SampleScene.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c9cfa26abfee488c85f1582747f6a02
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -3,6 +3,7 @@
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"Darkmatter.FonepayUnity",
|
||||
"UniTask",
|
||||
"UnityEngine.TestRunner"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "com.darkmattergameproduction.fonepay-unity",
|
||||
"displayName": "Fonepay Unity",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"unity": "6000.4",
|
||||
"unityRelease": "5f1",
|
||||
"description": "Fonepay payment integration for Unity. Generate Fonepay QR codes, await payment confirmation via websocket, and process tax refunds. Credentials managed via Tools > Fonepay > Settings.",
|
||||
|
||||
Reference in New Issue
Block a user