Question

Refund check of non-consumable purchase

  • 8 September 2023
  • 3 replies
  • 78 views

Badge +2

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? 


3 replies

Userlevel 4
Badge +8

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.

Badge +2

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 { ... }

}

 

Userlevel 4
Badge +8

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

Reply