From fdb1d18a0b4b941b986d55f66c589e29836494eb Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期二, 06 五月 2025 20:23:55 +0800 Subject: [PATCH] fix --- DolphinEnglishLearnStudent/Services/InPurchaseManager.swift | 41 +++++++++++++++++++++-------------------- 1 files changed, 21 insertions(+), 20 deletions(-) diff --git a/DolphinEnglishLearnStudent/Services/InPurchaseManager.swift b/DolphinEnglishLearnStudent/Services/InPurchaseManager.swift index 821194a..6fb09c4 100644 --- a/DolphinEnglishLearnStudent/Services/InPurchaseManager.swift +++ b/DolphinEnglishLearnStudent/Services/InPurchaseManager.swift @@ -110,27 +110,28 @@ } } - // func getIPAPrice(_ price:Int,clouse:@escaping (SKProduct)->Void){ - // var ipaId = "" - // switch price { - // case 98: ipaId = "com.jkfitness.a.price.1" - // case 298:ipaId = "com.jkfitness.a.price.2" - // case 488:ipaId = "com.jkfitness.a.price.3" - // case 698:ipaId = "com.jkfitness.a.price.4" - // case 998:ipaId = "com.jkfitness.a.price.5" - // default:break - // } - // - // var productIds = Set<String>() - // productIds.insert(ipaId) - // - // InPurchaseManager.instance().setProductList(productIds) {products in - // if let product = products.first{ - // clouse(product) - // } - // } - // } + static func testrefundRequest(for transactionID:UInt64) async{ + do{ + if #available(iOS 15.0, *) { + let windowScene = await UIApplication.shared.connectedScenes.first + let result = try await StoreKit.Transaction.beginRefundRequest(for: transactionID, in: windowScene as! UIWindowScene) + switch result { + case .success: + alert(msg: "退款申请发起成功") + case .userCancelled:break + @unknown default:break + } + } else { + // Fallback on earlier versions + } + }catch{ error + + print(error) + + + } + } func dismiss(){ InPurchaseManager._sharedInstance = nil -- Gitblit v1.7.1