beginRefundRequestForEntitlement static method

Future<RefundRequestStatus> beginRefundRequestForEntitlement(
  1. EntitlementInfo entitlement
)

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

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.

entitlement The entitlement to begin a refund request for.

Implementation

static Future<RefundRequestStatus> beginRefundRequestForEntitlement(
  EntitlementInfo entitlement,
) async {
  final statusCode = await _channel.invokeMethod(
    'beginRefundRequestForEntitlement',
    {'entitlementIdentifier': entitlement.identifier},
  );
  if (statusCode == null) throw UnsupportedPlatformException();
  return RefundRequestStatusExtension.from(statusCode);
}