Hi all,
I'm using StoreKit views for my in app store. While testing locally with a local storekit config, I can display the refund sheet for the correct product and tap refund, but my onRefundDismiss always handles the .failure case. The error messages I get have been non descriptive, i.e "Unable to Request Refund".
Weirdly enough, I can confirm through transaction manager that the refund does go through, it's just my onDismiss function is getting a failure case for some reason. Any help is appreciated.
The code below
// Somewhere in body
MyView()
.refundRequestSheet(for: storeModel.productId ?? 0, isPresented: $isShowRefund, onDismiss: onRefundDismiss)
// onRefundDismiss
private func onRefundDismiss(result: Result<StoreKit.Transaction.RefundRequestStatus, StoreKit.Transaction.RefundRequestError>){
switch result {
case .success(let refundStatus):
switch refundStatus {
case .success:
storeModel.handleBlockRefund() // Some function I call
case .userCancelled:
break
@unknown default:
break
}
case .failure(let errorVal):
alertTitle = "Refund failed"
alertMsg = errorVal.localizedDescription
}
}