Skip to content

Commit fd3fe9a

Browse files
committed
wx.requestMidasPayment.demo
1 parent 02feae0 commit fd3fe9a

File tree

9 files changed

+1129
-59
lines changed

9 files changed

+1129
-59
lines changed

Demo/API_V2/Assets/API/Payment.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 4a9e19ed69c041c408533b50f5572d0f, type: 3}
13+
m_Name: PaymentSO
14+
m_EditorClassIdentifier:
15+
categoryName: Payment
16+
categorySprite: {fileID: 0}
17+
entryList:
18+
- {fileID: 11400000, guid: dd332abe9d9fb41af85b675e4c8ea9f5, type: 2}

Demo/API_V2/Assets/API/Payment/PaymentSO.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Demo/API_V2/Assets/API/Payment/requestMidasPayment.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using WeChatWASM;
3+
using UnityEngine;
4+
public class RequestMidasPayment : Details
5+
{
6+
// 测试 API
7+
protected override void TestAPI(string[] args)
8+
{
9+
pay();
10+
}
11+
public void pay()
12+
{
13+
// 补充自己的信息,才能使用
14+
WX.RequestMidasPayment(new RequestMidasPaymentOption()
15+
{
16+
mode = "game",
17+
env = 0,
18+
offerId = "xxxx", //在米大师侧申请的应用 id
19+
currencyType = "CNY",
20+
success = (res) =>
21+
{
22+
Debug.Log("pay success!");
23+
},
24+
fail = (res) =>
25+
{
26+
Debug.Log("pay fail:" + res.errMsg);
27+
}
28+
});
29+
30+
// 显示成功的提示
31+
WX.ShowToast(new ShowToastOption()
32+
{
33+
title = "已调用虚拟支付"
34+
});
35+
}
36+
}

Demo/API_V2/Assets/API/Payment/requestMidasPayment/RequestMidasPayment.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: fb48e4613a53bb941a20036d7c08fefb, type: 3}
13+
m_Name: RequestMidasPaymentSO
14+
m_EditorClassIdentifier:
15+
entryScriptTypeName: RequestMidasPayment
16+
entryName: "\u53D1\u8D77\u7C73\u5927\u5E08\u652F\u4ED8"
17+
entryAPI: requestMidasPayment
18+
entryDescription:
19+
optionList: []
20+
initialButtonText: "\u652F\u4ED8"
21+
extraButtonList: []
22+
initialResultList: []

Demo/API_V2/Assets/API/Payment/requestMidasPayment/RequestMidasPaymentSO.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)