Skip to main content
Question

Refund check of non-consumable purchase

  • September 8, 2023
  • 3 replies
  • 142 views

Forum|alt.badge.img+3

I’m migrating iap other SDK to Revenuekit.

i know that there is no way to check refund status of consumable purchase. 

but in non-cosumable case, which user can purchase only one time, 

func getRefundCheck() {
Purchases.shared.restorePurchases { customerInfo, error in
if error == nil {
if self.isPremiumActive {
if customerInfo?.entitlements["Premium"]?.isActive == false {
self.isPremiumActive = false
}
}
}
}

Is this the right function for me to find refund users? 

This post has been closed for comments

3 replies

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • September 12, 2023

Hi,

Happy to help here. We have a guide on migrating purchases, in which you would call a similar function (syncPurchases) to fetch the relevant receipts.

We should be able to see the refund status on the receipt and not grant the user access to the app.


Forum|alt.badge.img+3
  • Author
  • New Member
  • September 12, 2023

Hi,

Happy to help here. We have a guide on migrating purchases, in which you would call a similar function (syncPurchases) to fetch the relevant receipts.

We should be able to see the refund status on the receipt and not grant the user access to the app.

 

Thank you for reply

I've read through the migrating purchases guide you added, but I didn't see anything about one-time purchases cases. so I wanted to double check. 


I'm currently using SwiftyStoreKit, and without importing any external CSV, I can use the Purchases.shared.getCustomerInfo function to see user’s current purchase state. right? 

 

func refundCheck() {
Purchases.shared.getCustomerInfo { info, error in
if error == nil {
if info?.entitlements["Premium"]?.isActive == false {
// User Not Purchased, or User Refunded Product
} else {
// User Purchased
}
}
}
}

***

@main
struct Main: App {
init() {
Purchases.logLevel = .debug
Purchases.configure(withAPIKey: "...")
abc.refundCheck()
}
var body: some View { ... }

}

 


Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • September 18, 2023

Yes, our migration would work for one time purchases as well.

 

As for the csv question, it depends on whether you do a “server-side” or “client-side” migration. The pros/cons of each we discuss here: https://www.revenuecat.com/docs/migrating-existing-subscriptions#determining-your-migration-path