beginRefundRequestForProduct static method

Future<RefundRequestStatus> beginRefundRequestForProduct(
  1. StoreProduct product
)

iOS 15+ only. Presents a refund request sheet in the current window scene for the latest transaction associated with the product

Returns RefundRequestStatus: The status of the refund request. Keep in mind the status could be RefundRequestStatus.userCancelled

If the request was unsuccessful, a PlatformException will be thrown. If called in an unsupported platform (Android or iOS < 15) a UnsupportedPlatformException will be thrown.

product The StoreProduct to begin a refund request for.

Implementation

static Future<RefundRequestStatus> beginRefundRequestForProduct(
  StoreProduct product,
) async {
  final statusCode = await _channel.invokeMethod(
    'beginRefundRequestForProduct',
    {'productIdentifier': product.identifier},
  );
  if (statusCode == null) throw UnsupportedPlatformException();
  return RefundRequestStatusExtension.from(statusCode);
}