|
|
@ -26,7 +26,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
@override |
|
|
@override |
|
|
void onInit() { |
|
|
void onInit() { |
|
|
super.onInit(); |
|
|
super.onInit(); |
|
|
_init(); |
|
|
_init(); // 初始化商品列表 |
|
|
// 处理冷启动场景:如果 App 通过深链直接启动 |
|
|
// 处理冷启动场景:如果 App 通过深链直接启动 |
|
|
_handleInitialDeepLink(); |
|
|
_handleInitialDeepLink(); |
|
|
} |
|
|
} |
|
|
@ -42,10 +42,10 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
|
|
|
|
|
Future<void> _init() async { |
|
|
Future<void> _init() async { |
|
|
loading.value = true; |
|
|
loading.value = true; |
|
|
error.value = ''; |
|
|
error.value = ''; // 重置错误信息 |
|
|
try { |
|
|
try { |
|
|
final list = await fetchProducts(); |
|
|
final list = await fetchProducts(); // 获取商品列表 |
|
|
items.assignAll(list); |
|
|
items.assignAll(list); // 更新商品列表 |
|
|
// iOS 环境下,在页面加载后批量查询当前商品的 IAP 详情,便于排查 StoreKit 可用商品 |
|
|
// iOS 环境下,在页面加载后批量查询当前商品的 IAP 详情,便于排查 StoreKit 可用商品 |
|
|
await _debugQueryIapProductsIfIos(); |
|
|
await _debugQueryIapProductsIfIos(); |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
@ -84,21 +84,22 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
|
|
|
|
|
/// 统一入口:根据后端配置决定是否弹出支付方式选择面板 |
|
|
/// 统一入口:根据后端配置决定是否弹出支付方式选择面板 |
|
|
Future<void> purchase(DBGoods item) async { |
|
|
Future<void> purchase(DBGoods item) async { |
|
|
// 读取渠道配置 |
|
|
// 1. 获取可用的支付方式 |
|
|
final enabled = _getEnabledPayMethods(); |
|
|
final enabled = _getEnabledPayMethods(); |
|
|
|
|
|
|
|
|
// 无配置或多个渠道:弹出选择面板 |
|
|
// 2. 无配置或多个渠道:弹出选择面板 |
|
|
_PayMethod? method; |
|
|
_PayMethod? method; |
|
|
if (enabled.length != 1) { |
|
|
if (enabled.length != 1) { |
|
|
method = await _showPayMethodSheet(enabled); |
|
|
method = await _showPayMethodSheet(enabled); |
|
|
if (method == null) return; |
|
|
if (method == null) return; |
|
|
} else { |
|
|
} else { |
|
|
// 仅一个渠道:直接走对应支付 |
|
|
// 3. 仅一个渠道:直接走对应支付 |
|
|
method = enabled.first; |
|
|
method = enabled.first; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 4. 根据选择的支付方式执行支付 |
|
|
bool ok = false; |
|
|
bool ok = false; |
|
|
String failMsg = '支付失败,请重试'; |
|
|
String failMsg = 'paymentFailedTryAgain'.tr; // 支付失败,请重试 |
|
|
isPaying.value = true; |
|
|
isPaying.value = true; |
|
|
_startPayingTimeout(); |
|
|
_startPayingTimeout(); |
|
|
if (method == _PayMethod.wechat) { |
|
|
if (method == _PayMethod.wechat) { |
|
|
@ -122,9 +123,9 @@ abstract class GoodsBaseController extends GetxController { |
|
|
if (!success) failMsg = msg ?? failMsg; |
|
|
if (!success) failMsg = msg ?? failMsg; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
// 5. 处理失败结果 |
|
|
if (!ok) { |
|
|
if (!ok) { |
|
|
Get.snackbar('提示', failMsg, |
|
|
Get.snackbar('tip'.tr, failMsg, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
margin: const EdgeInsets.all(12)); |
|
|
margin: const EdgeInsets.all(12)); |
|
|
} |
|
|
} |
|
|
@ -133,8 +134,10 @@ abstract class GoodsBaseController extends GetxController { |
|
|
/// 解析后端 paychannels 并结合平台过滤可用支付方式 |
|
|
/// 解析后端 paychannels 并结合平台过滤可用支付方式 |
|
|
List<_PayMethod> _getEnabledPayMethods() { |
|
|
List<_PayMethod> _getEnabledPayMethods() { |
|
|
try { |
|
|
try { |
|
|
|
|
|
//1. 获取后端配置的支付渠道 |
|
|
final paychannels = |
|
|
final paychannels = |
|
|
VersionUpdateService.to.cachedAppInfo?.paychannels ?? ''; |
|
|
VersionUpdateService.to.cachedAppInfo?.paychannels ?? ''; |
|
|
|
|
|
print('[Pay] 后端配置的支付渠道: $paychannels'); |
|
|
final raw = paychannels |
|
|
final raw = paychannels |
|
|
.split(',') |
|
|
.split(',') |
|
|
.map((e) => e.trim().toLowerCase()) |
|
|
.map((e) => e.trim().toLowerCase()) |
|
|
@ -230,7 +233,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
children: [ |
|
|
children: [ |
|
|
Text( |
|
|
Text( |
|
|
'选择支付方式', |
|
|
'selectPaymentMethod'.tr, // 选择支付方式 |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 16, |
|
|
fontSize: 16, |
|
|
fontWeight: FontWeight.w600, |
|
|
fontWeight: FontWeight.w600, |
|
|
@ -266,7 +269,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
), |
|
|
), |
|
|
const SizedBox(height: 8), |
|
|
const SizedBox(height: 8), |
|
|
Text( |
|
|
Text( |
|
|
'微信支付', |
|
|
'wechatPay'.tr, // 微信支付 |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 13, |
|
|
fontSize: 13, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
@ -300,7 +303,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
), |
|
|
), |
|
|
const SizedBox(height: 8), |
|
|
const SizedBox(height: 8), |
|
|
Text( |
|
|
Text( |
|
|
'支付宝', |
|
|
'alipayPay'.tr, // 支付宝 |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 13, |
|
|
fontSize: 13, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
@ -336,7 +339,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
), |
|
|
), |
|
|
const SizedBox(height: 8), |
|
|
const SizedBox(height: 8), |
|
|
Text( |
|
|
Text( |
|
|
'PayPal', |
|
|
'paypalPay'.tr, // PayPal |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 13, |
|
|
fontSize: 13, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
@ -372,7 +375,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
), |
|
|
), |
|
|
const SizedBox(height: 8), |
|
|
const SizedBox(height: 8), |
|
|
Text( |
|
|
Text( |
|
|
'Apple 内购', |
|
|
'appleIap'.tr, // Apple 内购 |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 13, |
|
|
fontSize: 13, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
@ -408,7 +411,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
), |
|
|
), |
|
|
const SizedBox(height: 8), |
|
|
const SizedBox(height: 8), |
|
|
Text( |
|
|
Text( |
|
|
'Google 内购', |
|
|
'googleIap'.tr, // Google 内购 |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 13, |
|
|
fontSize: 13, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
color: isDark ? Colors.white : Colors.black, |
|
|
@ -445,7 +448,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
notifyUrl: '$serverUrl/api/home/pay_wechatnotify', |
|
|
notifyUrl: '$serverUrl/api/home/pay_wechatnotify', |
|
|
); |
|
|
); |
|
|
if (paymentData == null) { |
|
|
if (paymentData == null) { |
|
|
onResult?.call(false, '创建微信订单失败'); |
|
|
onResult?.call(false, 'wechatOrderCreateFailed'.tr); // 创建微信订单失败 |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -465,7 +468,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
} else { |
|
|
} else { |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
_showPayResultDialog(false, msg ?? '支付失败'); |
|
|
_showPayResultDialog(false, msg ?? 'paymentFailed'.tr); // 支付失败 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
@ -482,7 +485,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
notifyUrl: 'https://api.ideapsound.com/api/home/pay_alipaynotify', |
|
|
notifyUrl: 'https://api.ideapsound.com/api/home/pay_alipaynotify', |
|
|
); |
|
|
); |
|
|
if (orderInfo == null) { |
|
|
if (orderInfo == null) { |
|
|
onResult?.call(false, '创建支付宝订单失败'); |
|
|
onResult?.call(false, 'alipayOrderCreateFailed'.tr); // 创建支付宝订单失败 |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -500,7 +503,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
} else { |
|
|
} else { |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
_showPayResultDialog(false, msg ?? '支付失败'); |
|
|
_showPayResultDialog(false, msg ?? 'paymentFailed'.tr); // 支付失败 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
@ -517,7 +520,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
amount: item.price, |
|
|
amount: item.price, |
|
|
); |
|
|
); |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
onResult?.call(false, '创建 Apple 订单失败'); |
|
|
onResult?.call(false, 'appleOrderCreateFailed'.tr); // 创建 Apple 订单失败 |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -547,7 +550,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
} else { |
|
|
} else { |
|
|
Get.snackbar('提示', msg, |
|
|
Get.snackbar('tip'.tr, msg, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
margin: const EdgeInsets.all(12)); |
|
|
margin: const EdgeInsets.all(12)); |
|
|
} |
|
|
} |
|
|
@ -555,7 +558,10 @@ abstract class GoodsBaseController extends GetxController { |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
onResult?.call(false, 'Apple 内购异常: $e'); |
|
|
onResult?.call( |
|
|
|
|
|
false, |
|
|
|
|
|
'paymentExceptionWithError' |
|
|
|
|
|
.trParams({'error': e.toString()})); // 支付异常: @error |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -573,7 +579,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
amount: item.price, |
|
|
amount: item.price, |
|
|
); |
|
|
); |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
onResult?.call(false, '创建 Google 订单失败'); |
|
|
onResult?.call(false, 'googleOrderCreateFailed'.tr); // 创建 Google 订单失败 |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -602,7 +608,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
} else { |
|
|
} else { |
|
|
Get.snackbar('提示', msg, |
|
|
Get.snackbar('tip'.tr, msg, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
margin: const EdgeInsets.all(12)); |
|
|
margin: const EdgeInsets.all(12)); |
|
|
} |
|
|
} |
|
|
@ -610,7 +616,10 @@ abstract class GoodsBaseController extends GetxController { |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
onResult?.call(false, 'Google 内购异常: $e'); |
|
|
onResult?.call( |
|
|
|
|
|
false, |
|
|
|
|
|
'paymentExceptionWithError' |
|
|
|
|
|
.trParams({'error': e.toString()})); // 支付异常: @error |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -641,11 +650,12 @@ abstract class GoodsBaseController extends GetxController { |
|
|
}) async { |
|
|
}) async { |
|
|
// 若无法获取订单号,直接弹成功提示但提醒稍后刷新 |
|
|
// 若无法获取订单号,直接弹成功提示但提醒稍后刷新 |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
_showPayResultDialog(true, '${channel}支付成功,订单处理中,请稍后查看。'); |
|
|
_showPayResultDialog( |
|
|
|
|
|
true, 'paymentProcessingCheckLater'.tr); // 订单处理中,请稍后查看 |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String message = initialMessage ?? '${channel}支付成功'; |
|
|
String message = initialMessage ?? 'paymentSuccess'.tr; // 支付成功 |
|
|
bool success = false; |
|
|
bool success = false; |
|
|
try { |
|
|
try { |
|
|
// 简单轮询回查,避免回调延迟 |
|
|
// 简单轮询回查,避免回调延迟 |
|
|
@ -677,7 +687,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
} catch (_) {} |
|
|
} catch (_) {} |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
message = '查询支付结果异常: $e'; |
|
|
message = 'paymentResultQueryException' |
|
|
|
|
|
.trParams({'error': e.toString()}); // 查询支付结果异常: @error |
|
|
} |
|
|
} |
|
|
_showPayResultDialog(success, message); |
|
|
_showPayResultDialog(success, message); |
|
|
} |
|
|
} |
|
|
@ -695,7 +706,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
if (orderStatus == 1 && user != null) { |
|
|
if (orderStatus == 1 && user != null) { |
|
|
User.instance.updateUserInfo(user); |
|
|
User.instance.updateUserInfo(user); |
|
|
_payService.setVipExptime(User.instance.vipexptime); |
|
|
_payService.setVipExptime(User.instance.vipexptime); |
|
|
Get.snackbar('提示', '订单已确认,额度已刷新', |
|
|
Get.snackbar('tip'.tr, 'orderConfirmedQuotaRefreshed'.tr, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
margin: const EdgeInsets.all(12)); |
|
|
margin: const EdgeInsets.all(12)); |
|
|
return; |
|
|
return; |
|
|
@ -718,6 +729,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
final context = Get.context; |
|
|
final context = Get.context; |
|
|
final isDark = |
|
|
final isDark = |
|
|
context != null && Theme.of(context).brightness == Brightness.dark; |
|
|
context != null && Theme.of(context).brightness == Brightness.dark; |
|
|
|
|
|
final titleText = |
|
|
|
|
|
success ? 'paymentSuccess'.tr : 'paymentFailed'.tr; // 支付成功/支付失败 |
|
|
Get.dialog( |
|
|
Get.dialog( |
|
|
Dialog( |
|
|
Dialog( |
|
|
insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24), |
|
|
insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24), |
|
|
@ -753,7 +766,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Text( |
|
|
Text( |
|
|
success ? '支付成功' : '支付失败', |
|
|
titleText, |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 18, |
|
|
fontSize: 18, |
|
|
fontWeight: FontWeight.w700, |
|
|
fontWeight: FontWeight.w700, |
|
|
@ -781,7 +794,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
children: [ |
|
|
children: [ |
|
|
TextButton( |
|
|
TextButton( |
|
|
onPressed: () => Get.back(), |
|
|
onPressed: () => Get.back(), |
|
|
child: const Text('知道了'), |
|
|
child: Text('gotIt'.tr), // 知道了 |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
@ -817,7 +830,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
notifyUrl: 'https://api.ideapsound.com/api/home/pay_paypalnotify', |
|
|
notifyUrl: 'https://api.ideapsound.com/api/home/pay_paypalnotify', |
|
|
); |
|
|
); |
|
|
if (approvalUrl == null) { |
|
|
if (approvalUrl == null) { |
|
|
onResult?.call(false, '创建 PayPal 订单失败'); |
|
|
onResult?.call(false, 'paypalOrderCreateFailed'.tr); // 创建 PayPal 订单失败 |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
return false; |
|
|
return false; |
|
|
@ -846,14 +859,14 @@ abstract class GoodsBaseController extends GetxController { |
|
|
await _confirmOrderAndShow( |
|
|
await _confirmOrderAndShow( |
|
|
orderId, |
|
|
orderId, |
|
|
channel: 'PayPal', |
|
|
channel: 'PayPal', |
|
|
initialMessage: '支付完成,正在确认', |
|
|
initialMessage: 'paymentCompletedConfirming'.tr, // 支付完成,正在确认 |
|
|
retries: 1, |
|
|
retries: 1, |
|
|
intervalMs: 0, |
|
|
intervalMs: 0, |
|
|
); |
|
|
); |
|
|
} else if (path == '/cancel') { |
|
|
} else if (path == '/cancel') { |
|
|
isPaying.value = false; |
|
|
isPaying.value = false; |
|
|
_cancelPayingTimeout(); |
|
|
_cancelPayingTimeout(); |
|
|
_showPayResultDialog(false, '已取消支付'); |
|
|
_showPayResultDialog(false, 'paymentCancelled'.tr); // 已取消支付 |
|
|
} |
|
|
} |
|
|
// 一次性监听,处理后即取消 |
|
|
// 一次性监听,处理后即取消 |
|
|
_deeplinkSub?.cancel(); |
|
|
_deeplinkSub?.cancel(); |
|
|
@ -871,12 +884,13 @@ abstract class GoodsBaseController extends GetxController { |
|
|
if (success) { |
|
|
if (success) { |
|
|
// 仅提示已打开授权页面,不在此处回查与弹窗,等待深链回跳后再处理 |
|
|
// 仅提示已打开授权页面,不在此处回查与弹窗,等待深链回跳后再处理 |
|
|
print('[PayPal] 已打开授权页面,等待回跳后再确认。orderId: $orderId'); |
|
|
print('[PayPal] 已打开授权页面,等待回跳后再确认。orderId: $orderId'); |
|
|
Get.snackbar('提示', msg ?? '已打开 PayPal,请在浏览器完成支付', |
|
|
Get.snackbar('tip'.tr, msg ?? 'paypalOpenedCompleteInBrowser'.tr, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
margin: const EdgeInsets.all(12)); |
|
|
margin: const EdgeInsets.all(12)); |
|
|
} else { |
|
|
} else { |
|
|
// 无法打开授权页才提示失败 |
|
|
// 无法打开授权页才提示失败 |
|
|
_showPayResultDialog(false, msg ?? '无法打开 PayPal 支付页面'); |
|
|
_showPayResultDialog( |
|
|
|
|
|
false, msg ?? 'paypalOpenFailed'.tr); // 无法打开 PayPal 支付页面 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
@ -899,13 +913,13 @@ abstract class GoodsBaseController extends GetxController { |
|
|
await _confirmOrderAndShow( |
|
|
await _confirmOrderAndShow( |
|
|
orderId, |
|
|
orderId, |
|
|
channel: 'PayPal', |
|
|
channel: 'PayPal', |
|
|
initialMessage: '支付完成,正在确认', |
|
|
initialMessage: 'paymentCompletedConfirming'.tr, // 支付完成,正在确认 |
|
|
retries: 1, |
|
|
retries: 1, |
|
|
intervalMs: 0, |
|
|
intervalMs: 0, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} else if (uri.path == '/cancel') { |
|
|
} else if (uri.path == '/cancel') { |
|
|
_showPayResultDialog(false, '已取消支付'); |
|
|
_showPayResultDialog(false, 'paymentCancelled'.tr); // 已取消支付 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (_) { |
|
|
} catch (_) { |
|
|
|