beginRefundRequest(for:in:)
Presents the refund request sheet for the specified transaction in a view controller.
Declaration
static func beginRefundRequest(for transactionID: UInt64, in controller: NSViewController) async throws -> Transaction.RefundRequestStatusParameters
- transactionID:
The identifier of the transaction the user is requesting a refund for.
- controller:
The Nsviewcontroller that the system displays the sheet on.
Mentioned in
Return Value
Discussion
Call this function from account settings or a help menu to enable customers to request a refund for an in-app purchase within your app. When you call this function, the system displays a refund sheet with the customer’s purchase details and a list of reason codes for the customer to choose from. For design guidance, see Human Interface Guidelines > In-app purchase > Providing help with in-app purchases.
When a customer requests a refund for consumable in-app purchases through your app, the App Stores sends a CONSUMPTION_REQUEST notificationType to your server. If the customer provided consent, respond by sending consumption data to the App Store using the Send Consumption Information endpoint. If not, don’t respond to the CONSUMPTION_REQUEST notification.
The App Store takes up to 48 hours to either approve or deny a refund.
For information about setting up your server to receive notifications, see Enabling App Store Server Notifications.
Test refund requests
The sandbox environment and StoreKit Testing in Xcode both support testing refund requests. For more information, see Testing refund requests.