|
|
|
@ -446,6 +446,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
); |
|
|
|
if (paymentData == null) { |
|
|
|
onResult?.call(false, '创建微信订单失败'); |
|
|
|
isPaying.value = false; |
|
|
|
_cancelPayingTimeout(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
final orderId = |
|
|
|
@ -481,6 +483,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
); |
|
|
|
if (orderInfo == null) { |
|
|
|
onResult?.call(false, '创建支付宝订单失败'); |
|
|
|
isPaying.value = false; |
|
|
|
_cancelPayingTimeout(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
final orderId = _payService.lastOrderId; // 创建订单时已缓存 |
|
|
|
@ -514,6 +518,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
); |
|
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
|
onResult?.call(false, '创建 Apple 订单失败'); |
|
|
|
isPaying.value = false; |
|
|
|
_cancelPayingTimeout(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
// 使用商品id作为内购的 productId(与后台保持一致) |
|
|
|
@ -568,6 +574,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
); |
|
|
|
if (orderId == null || orderId.isEmpty) { |
|
|
|
onResult?.call(false, '创建 Google 订单失败'); |
|
|
|
isPaying.value = false; |
|
|
|
_cancelPayingTimeout(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
isPaying.value = true; |
|
|
|
@ -650,6 +658,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
final orderStatus = order["status"]; |
|
|
|
if (orderStatus == 1) { |
|
|
|
User.instance.updateUserInfo(user); |
|
|
|
_payService.setVipExptime(User.instance.vipexptime); |
|
|
|
success = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
@ -685,6 +694,7 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
final orderStatus = order['status']; |
|
|
|
if (orderStatus == 1 && user != null) { |
|
|
|
User.instance.updateUserInfo(user); |
|
|
|
_payService.setVipExptime(User.instance.vipexptime); |
|
|
|
Get.snackbar('提示', '订单已确认,额度已刷新', |
|
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
|
margin: const EdgeInsets.all(12)); |
|
|
|
@ -808,6 +818,8 @@ abstract class GoodsBaseController extends GetxController { |
|
|
|
); |
|
|
|
if (approvalUrl == null) { |
|
|
|
onResult?.call(false, '创建 PayPal 订单失败'); |
|
|
|
isPaying.value = false; |
|
|
|
_cancelPayingTimeout(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
final orderId = _payService.lastOrderId; // 创建订单时已缓存 |
|
|
|
|