toPlatformCode static method

dynamic toPlatformCode(
  1. ErrorCode errorCode,
  2. IapPlatform platform
)

Maps an ErrorCode enum to platform-specific code

Implementation

static dynamic toPlatformCode(ErrorCode errorCode, IapPlatform platform) {
  if (platform == IapPlatform.IOS) {
    return ErrorCodeMapping.ios[errorCode] ?? 0;
  } else {
    return ErrorCodeMapping.android[errorCode] ?? 'E_UNKNOWN';
  }
}