Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit a646ed94
authored
2026-07-15 15:21:03 +0800
by
ethanlamzs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ios支付
1 parent
bc389b39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
lib/data/repositories/message/xe_create_order_handler.dart
lib/services/subscription_service_ios.dart
lib/data/repositories/message/xe_create_order_handler.dart
View file @
a646ed9
...
@@ -59,11 +59,13 @@ class XeCreateOrderHandler extends MessageHandler {
...
@@ -59,11 +59,13 @@ class XeCreateOrderHandler extends MessageHandler {
// 1. 请求后端获取预支付订单信息
// 1. 请求后端获取预支付订单信息
final
deviceType
=
Platform
.
isIOS
?
"ios"
:
"andorid"
;
final
deviceType
=
Platform
.
isIOS
?
"ios"
:
"andorid"
;
print
(
"[debug]. handleMessage 1 "
+
deviceType
);
if
(
deviceType
==
'andorid'
){
if
(
deviceType
==
'andorid'
){
return
await
_wx_pay_proc_
(
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
duration
,
durationType
,
totalFee
,
renew
,
useCoin
);
return
await
_wx_pay_proc_
(
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
duration
,
durationType
,
totalFee
,
renew
,
useCoin
);
}
else
if
(
deviceType
==
'ios'
){
}
else
if
(
deviceType
==
'ios'
){
// 暂时不支持使用学币扣减
// 暂时不支持使用学币扣减
// 执行ios支付
await
_subService
.
initialize
();
return
await
_ios_pay_proc_
(
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
duration
,
durationType
,
totalFee
,
renew
,
false
);
return
await
_ios_pay_proc_
(
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
duration
,
durationType
,
totalFee
,
renew
,
false
);
}
}
...
@@ -201,6 +203,8 @@ class XeCreateOrderHandler extends MessageHandler {
...
@@ -201,6 +203,8 @@ class XeCreateOrderHandler extends MessageHandler {
// 执行ios的微信支付
// 执行ios的微信支付
Future
<
dynamic
>
_ios_pay_proc_
(
String
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
int
duration
,
durationType
,
totalFee
,
bool
renew
,
useCoin
)
async
{
Future
<
dynamic
>
_ios_pay_proc_
(
String
userCode
,
tbxStuId
,
chargeCode
,
deviceType
,
phone
,
stuId
,
ext
,
int
duration
,
durationType
,
totalFee
,
bool
renew
,
useCoin
)
async
{
// 暂时用固定的价格
// 暂时用固定的价格
var
result
=
await
_userAuthRepository
.
createOrder
(
userCode
,
tbxStuId
,
chargeCode
,
duration
,
durationType
,
totalFee
,
var
result
=
await
_userAuthRepository
.
createOrder
(
userCode
,
tbxStuId
,
chargeCode
,
duration
,
durationType
,
totalFee
,
renew
,
phone
,
stuId
,
ext
,
useCoin
?
1
:
0
,
deviceType
);
renew
,
phone
,
stuId
,
ext
,
useCoin
?
1
:
0
,
deviceType
);
...
@@ -227,8 +231,7 @@ class XeCreateOrderHandler extends MessageHandler {
...
@@ -227,8 +231,7 @@ class XeCreateOrderHandler extends MessageHandler {
throw
Exception
(
'支付参数获取失败'
);
throw
Exception
(
'支付参数获取失败'
);
}
}
// 执行ios支付
await
_subService
.
initialize
();
// 为了调试,先模拟
// 为了调试,先模拟
var
product
;
var
product
;
...
...
lib/services/subscription_service_ios.dart
View file @
a646ed9
...
@@ -62,7 +62,8 @@ class SubscriptionService {
...
@@ -62,7 +62,8 @@ class SubscriptionService {
await
_fetchProducts
();
await
_fetchProducts
();
// 4. 处理待处理的交易(应用被杀掉时未完成交易)
// 4. 处理待处理的交易(应用被杀掉时未完成交易)
await
_iap
.
restorePurchases
();
// 订阅恢复也会触发 purchaseStream
//await _iap.restorePurchases(); // 订阅恢复也会触发 purchaseStream
}
}
// ---------- 获取产品信息 ----------
// ---------- 获取产品信息 ----------
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment