{"version":3,"sources":["../../../src/payments-refunds-v1-refund-refunds.public.ts","../../../src/payments-refunds-v1-refund-refunds.universal.ts","../../../src/payments-refunds-v1-refund-refunds.http.ts","../../../src/payments-refunds-v1-refund-refunds.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  CreateRefundApplicationErrors,\n  CreateRefundOptions,\n  QueryRefundsResponse,\n  Refund,\n  RefundCreatedEnvelope,\n  RefundQuery,\n  RefundUpdatedEnvelope,\n  RefundsQueryBuilder,\n  createRefund as universalCreateRefund,\n  getRefund as universalGetRefund,\n  queryRefunds as universalQueryRefunds,\n  typedQueryRefunds as universalTypedQueryRefunds,\n} from './payments-refunds-v1-refund-refunds.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function createRefund(httpClient: HttpClient): CreateRefundSignature {\n  return (\n    refund: NonNullablePaths<Refund, `chargeId`, 2>,\n    options?: CreateRefundOptions\n  ) =>\n    universalCreateRefund(\n      refund,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateRefundSignature {\n  /**\n   * Creates a refund.\n   *\n   * The refunding process starts immediately after a refund entity is created.\n   *\n   * If you specify an `amount`, you must also specify a `currency_code`. This currency should be the same as the currency of the charge.\n   * If `amount` and `currency_code` are not specified, the refund is created for the full charge amount. If the charge was already partially refunded, this refund will fail.\n   * @param - Refund to be created.\n   * @returns The created refund.\n   */\n  (\n    refund: NonNullablePaths<Refund, `chargeId`, 2>,\n    options?: CreateRefundOptions\n  ): Promise<\n    NonNullablePaths<Refund, `status` | `statusInfo.code`, 3> & {\n      __applicationErrorsType?: CreateRefundApplicationErrors;\n    }\n  >;\n}\n\nexport function getRefund(httpClient: HttpClient): GetRefundSignature {\n  return (refundId: string) =>\n    universalGetRefund(\n      refundId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetRefundSignature {\n  /**\n   * Retrieves a refund.\n   * @param - ID of the refund to retrieve.\n   * @returns The requested refund.\n   */\n  (refundId: string): Promise<\n    NonNullablePaths<Refund, `status` | `statusInfo.code`, 3>\n  >;\n}\n\nexport function queryRefunds(httpClient: HttpClient): QueryRefundsSignature {\n  return () =>\n    universalQueryRefunds(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryRefundsSignature {\n  /**\n   * Creates a query to retrieve a list of refunds.\n   *\n   *\n   * The `queryRefunds()` method builds a query to retrieve a list of refunds and returns a [RefundsQueryBuilder](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/ascending) object.\n   *\n   * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/find) method.\n   *\n   * You can refine the query by chaining `RefundsQueryBuilder` methods onto the query. `RefundsQueryBuilder` methods enable you to sort, filter, and control the results that `queryRefunds.find()` returns.\n   *\n   * The query runs with the following `RefundsQueryBuilder` defaults that you can override:\n   *\n   * - [`skipTo(0)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/skip-to)\n   * - [`limit(50)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/limit)\n   * - [`descending(\"_createdDate\")`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/descending)\n   *\n   * The methods that are chained to `queryRefunds()` are applied in the order they are called.\n   *\n   * The table below shows which `RefundsQueryBuilder` methods are supported for `queryRefunds()`. You can only use one filter method for each property. Only the first filter will work if a property is used in more than one filter.\n   */\n  (): RefundsQueryBuilder;\n}\n\nexport function typedQueryRefunds(\n  httpClient: HttpClient\n): TypedQueryRefundsSignature {\n  return (query: RefundQuery) =>\n    universalTypedQueryRefunds(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQueryRefundsSignature {\n  /** @returns A `RefundsQueryBuilder` object that contains the refined query. */\n  (query: RefundQuery): Promise<\n    NonNullablePaths<\n      QueryRefundsResponse,\n      | `refunds`\n      | `refunds.${number}.status`\n      | `refunds.${number}.statusInfo.code`,\n      5\n    >\n  >;\n}\n\nexport const onRefundCreated = EventDefinition(\n  'wix.payments.refunds.v1.refund_created',\n  true,\n  (event: RefundCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<RefundCreatedEnvelope>();\nexport const onRefundUpdated = EventDefinition(\n  'wix.payments.refunds.v1.refund_updated',\n  true,\n  (event: RefundUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n            { path: 'modifiedFields.createdDate' },\n            { path: 'modifiedFields.updatedDate' },\n          ],\n        },\n      ])\n    )\n)<RefundUpdatedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  BaseEventMetadata,\n  CreateRefundOptions,\n  CreateRefundRequest,\n  CreateRefundResponse,\n  CursorPaging,\n  CursorPagingMetadata,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Cursors,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  ExtendedFields,\n  GetRefundRequest,\n  GetRefundResponse,\n  GetRefundabilityRequest,\n  GetRefundabilityResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  Initiator,\n  MessageEnvelope,\n  QueryRefundsRequest,\n  QueryRefundsResponse,\n  Refund,\n  RefundCreatedEnvelope,\n  RefundDetails,\n  RefundQuerySpec,\n  RefundUpdatedEnvelope,\n  Refundability,\n  RefundabilityDetailsOneOf,\n  RefundsQueryBuilder,\n  RefundsQueryResult,\n  RejectionDetails,\n  RejectionReason,\n  RestoreInfo,\n  SortOrder,\n  Sorting,\n  Status,\n  StatusInfo,\n  SyncRefundRequest,\n  SyncRefundResponse,\n  UpdateExtendedFieldsRequest,\n  UpdateExtendedFieldsResponse,\n  WebhookIdentityType,\n  utils,\n} from './payments-refunds-v1-refund-refunds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n  HttpClient,\n  HttpResponse,\n  NonNullablePaths,\n  QuerySpec,\n  Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsRefundsV1Refund from './payments-refunds-v1-refund-refunds.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/** The refund object. A refund object is the record of an attempt to return charged funds. */\nexport interface Refund {\n  /**\n   * Refund ID.\n   * @readonly\n   * @immutable\n   * @format GUID\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the refund is updated.\n   *\n   * Ignored when creating a refund.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * Date and time the refund was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. For example, \"2024-01-30T13:30:00\".\n   * @readonly\n   * @immutable\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the refund was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. For example, \"2024-01-30T13:30:00\".\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Custom field data for the refund object.\n   *\n   * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.\n   */\n  extendedFields?: ExtendedFields;\n  /**\n   * ID of the charge to refund.\n   * @immutable\n   * @format GUID\n   */\n  chargeId?: string | null;\n  /**\n   * Refund currency. Should be the same as the charge currency.\n   * @immutable\n   * @format CURRENCY\n   */\n  currencyCode?: string | null;\n  /**\n   * Amount being returned to the buyer in the refund currency's main units (such as dollars or euros).\n   * For example, `\"12.95\"`.\n   * @immutable\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  amount?: string | null;\n  /**\n   * Application fee returned to the merchant from Wix in the refund currency's main units (such as dollars or euros). For example, `\"12.95\"`.\n   *\n   * Only included if an application fee was returned.\n   * @readonly\n   * @immutable\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  returnedApplicationFee?: string | null;\n  /**\n   * Processing fee returned to the merchant from the payment service provider in the refund currency's main units (such as dollars or euros). For example, `\"12.95\"`.\n   *\n   * This field is empty when the processing fee is unknown.\n   * @readonly\n   * @immutable\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  returnedProcessingFee?: string | null;\n  /**\n   * Whether the refund is for the entire amount of the charge.\n   * @readonly\n   * @immutable\n   */\n  full?: boolean | null;\n  /**\n   * Status of the refund.\n   *\n   * Learn more about the [refund lifecycle](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#lifecycle-of-a-refund>).\n   * @readonly\n   */\n  status?: StatusWithLiterals;\n  /**\n   * Payment service provider's ID for the refund.\n   * @readonly\n   * @immutable\n   * @minLength 1\n   * @maxLength 100\n   */\n  providerRefundId?: string | null;\n  /**\n   * Reason this refund was issued.\n   * @minLength 1\n   * @maxLength 1000\n   */\n  reason?: string | null;\n  /**\n   * Details about the refund status.\n   * Used to provide additional information about why a refund was given its status.\n   * @readonly\n   */\n  statusInfo?: StatusInfo;\n  /**\n   * Unique number assigned to a refund. This number is shared across all parties involved in processing the refund. It allows the merchant to track the refund with their bank.\n   * @readonly\n   * @immutable\n   * @minLength 1\n   * @maxLength 30\n   */\n  acquirerReferenceNumber?: string | null;\n  /**\n   * Note providing additional information about this refund.\n   * @immutable\n   * @minLength 1\n   * @maxLength 200\n   */\n  note?: string | null;\n}\n\nexport interface ExtendedFields {\n  /**\n   * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n   * The value of each key is structured according to the schema defined when the extended fields were configured.\n   *\n   * You can only access fields for which you have the appropriate permissions.\n   *\n   * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n   */\n  namespaces?: Record<string, Record<string, any>>;\n}\n\nexport enum Status {\n  /** Refund is in progress. */\n  PENDING = 'PENDING',\n  /** Refund succeeded. */\n  SUCCEEDED = 'SUCCEEDED',\n  /** Refund failed. */\n  FAILED = 'FAILED',\n  /** Refund had succeeded, but has since been reversed. */\n  REVERSED = 'REVERSED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n  | Status\n  | 'PENDING'\n  | 'SUCCEEDED'\n  | 'FAILED'\n  | 'REVERSED';\n\nexport enum Initiator {\n  WIX = 'WIX',\n  API = 'API',\n  PROVIDER = 'PROVIDER',\n}\n\n/** @enumType */\nexport type InitiatorWithLiterals = Initiator | 'WIX' | 'API' | 'PROVIDER';\n\nexport interface StatusInfo {\n  /**\n   * Reason code with detailed information about the refund status.\n   * See the full list of [reason codes](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes#refund-declined).\n   * @minLength 1\n   * @maxLength 10\n   */\n  code?: string;\n  /**\n   * Description of the status.\n   * @minLength 1\n   * @maxLength 1000\n   */\n  description?: string | null;\n}\n\nexport interface CreateRefundRequest {\n  /** Refund to be created. */\n  refund: Refund;\n  /**\n   * Amount of the charge that was previously refunded.\n   *\n   * Specify this to compare your records of previously refunded amounts against those on the server. If they don't match, this method will return an error with the code `PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH`.\n   *\n   * Learn more about [preventing unintended refunds](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds).\n   * @decimalValue options { gte:0, maxScale:8 }\n   */\n  previouslyRefundedAmount?: string | null;\n}\n\nexport interface CreateRefundResponse {\n  /** The created refund. */\n  refund?: Refund;\n}\n\nexport interface GetRefundRequest {\n  /**\n   * ID of the refund to retrieve.\n   * @format GUID\n   */\n  refundId: string;\n}\n\nexport interface GetRefundResponse {\n  /** The requested refund. */\n  refund?: Refund;\n}\n\nexport interface QueryRefundsRequest {\n  /** Query options. */\n  query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object in the following format:\n   * `\"filter\" : {\n   * \"fieldName1\": \"value1\",\n   * \"fieldName2\":{\"$operator\":\"value2\"}\n   * }`\n   * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object in the following format:\n   * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n   * @maxSize 4\n   */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 64\n   */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n  /**\n   * Number of items to load.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * You can get the relevant cursor token\n   * from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   * @maxLength 16000\n   */\n  cursor?: string | null;\n}\n\nexport interface QueryRefundsResponse {\n  /** List of refunds. */\n  refunds?: Refund[];\n  /** Metadata for the paginated results. */\n  pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  cursors?: Cursors;\n  /**\n   * Indicates if there are more results after the current page.\n   * If `true`, another page of results can be retrieved.\n   * If `false`, this is the last page.\n   */\n  hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n  /**\n   * Cursor pointing to next page in the list of results.\n   * @maxLength 16000\n   */\n  next?: string | null;\n  /**\n   * Cursor pointing to previous page in the list of results.\n   * @maxLength 16000\n   */\n  prev?: string | null;\n}\n\nexport interface UpdateExtendedFieldsRequest {\n  /** ID of the entity to update. */\n  _id?: string;\n  /** Identifier for the app whose extended fields are being updated. */\n  namespace?: string;\n  /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */\n  namespaceData?: Record<string, any> | null;\n}\n\nexport interface UpdateExtendedFieldsResponse {\n  /** Updated refund. */\n  refund?: Refund;\n}\n\nexport interface GetRefundabilityRequest {\n  /**\n   * ID of the charge to calculate refundability for.\n   * @format GUID\n   */\n  chargeId?: string;\n}\n\nexport interface GetRefundabilityResponse {\n  /** Refundability of the charge. */\n  refundability?: Refundability;\n}\n\n/**\n * Internal notes:\n *\n * Instead of separate Refundability and PartialRefundability, we provide min and max refund amount.\n * If only full refund is possible, min_refund_amount = max_refund_amount = charge amount.\n */\nexport interface Refundability extends RefundabilityDetailsOneOf {\n  /** When the charge is refundable, specifies the allowed range for the refund amount. */\n  refundDetails?: RefundDetails;\n  /** When charge is not refundable, specifies why the refund is not allowed. */\n  rejectionDetails?: RejectionDetails;\n  /** Whether you can refund the charge. This depends on your app's permissions, and the permissions of the user checking the refundability. */\n  refundable?: boolean;\n  /**\n   * Charge currency.\n   * @format CURRENCY\n   */\n  currencyCode?: string | null;\n  /**\n   * Sum of amounts of previous refunds for this charge with the `SUCCEEDED` status in the charge currency's main units (such as dollars or euros). For example, `\"6.47\"`.\n   * Used to [prevent unintended refunds](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds).\n   * @decimalValue options { gte:0, maxScale:8 }\n   */\n  previouslyRefundedAmount?: string | null;\n}\n\n/** @oneof */\nexport interface RefundabilityDetailsOneOf {\n  /** When the charge is refundable, specifies the allowed range for the refund amount. */\n  refundDetails?: RefundDetails;\n  /** When charge is not refundable, specifies why the refund is not allowed. */\n  rejectionDetails?: RejectionDetails;\n}\n\nexport interface RefundDetails {\n  /**\n   * Minimum allowed refund amount in the refund currency's main units (such as dollars or euros). For example, `\"0.50\"`.\n   * @decimalValue options { gte:0, maxScale:8 }\n   */\n  minRefundAmount?: string | null;\n  /**\n   * Maximum allowed refund amount in the refund currency's main units (such as dollars or euros). For example, `\"12.95\"`.\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  maxRefundAmount?: string | null;\n}\n\nexport interface RejectionDetails {\n  /** Reason the refund was rejected. */\n  reason?: RejectionReasonWithLiterals;\n}\n\nexport enum RejectionReason {\n  /** Charge was fully refunded. */\n  CHARGE_REFUNDED = 'CHARGE_REFUNDED',\n  /** Another refund was initiated for this charge and is waiting for confirmation from the provider. */\n  CHARGE_REFUND_IN_PROGRESS = 'CHARGE_REFUND_IN_PROGRESS',\n  /** Charge was disputed. */\n  CHARGE_DISPUTED = 'CHARGE_DISPUTED',\n  /** Charge is too old to be refunded. */\n  CHARGE_REFUND_PERIOD_ENDED = 'CHARGE_REFUND_PERIOD_ENDED',\n  /** Charge is unpaid. */\n  CHARGE_UNPAID = 'CHARGE_UNPAID',\n  /** PSP is temporarily unavailable. */\n  PROVIDER_DOWN = 'PROVIDER_DOWN',\n  /**\n   * PSP doesn't support the refund for one of the following reasons:\n   * - The PSP doesn't currently support refunds.\n   * - The charge is in an invalid state.\n   * - The PSP does not have the required information for this transaction.\n   */\n  PROVIDER_NOT_SUPPORTED = 'PROVIDER_NOT_SUPPORTED',\n  /** Payment method used for the charge doesn't support refunds. */\n  PAYMENT_METHOD_NOT_SUPPORTED = 'PAYMENT_METHOD_NOT_SUPPORTED',\n  /** Merchant doesn't have enough balance to issue a refund for the charge. */\n  MERCHANT_BALANCE_INSUFFICIENT = 'MERCHANT_BALANCE_INSUFFICIENT',\n  /** Charges done via POS terminal and should be refunded on that POS terminal. */\n  ONLINE_REFUND_NOT_SUPPORTED = 'ONLINE_REFUND_NOT_SUPPORTED',\n  /** The identity requesting the refund doesn't have the required permissions. This can occur if a site collaborator attempts to create a refund on behalf of the merchant. */\n  NOT_AUTHORIZED = 'NOT_AUTHORIZED',\n}\n\n/** @enumType */\nexport type RejectionReasonWithLiterals =\n  | RejectionReason\n  | 'CHARGE_REFUNDED'\n  | 'CHARGE_REFUND_IN_PROGRESS'\n  | 'CHARGE_DISPUTED'\n  | 'CHARGE_REFUND_PERIOD_ENDED'\n  | 'CHARGE_UNPAID'\n  | 'PROVIDER_DOWN'\n  | 'PROVIDER_NOT_SUPPORTED'\n  | 'PAYMENT_METHOD_NOT_SUPPORTED'\n  | 'MERCHANT_BALANCE_INSUFFICIENT'\n  | 'ONLINE_REFUND_NOT_SUPPORTED'\n  | 'NOT_AUTHORIZED';\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\nexport interface SyncRefundRequest {\n  /**\n   * Refund ID.\n   * @format GUID\n   */\n  refundId?: string | null;\n  /**\n   * ID of the refund on the PSP side.\n   * @minLength 1\n   * @maxLength 100\n   */\n  providerRefundId?: string | null;\n  /**\n   * ID of charge for which the funds are returned by this refund.\n   * @format GUID\n   */\n  chargeId?: string | null;\n  /**\n   * Status of the refund.\n   * Read more about statuses in this [article](<https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#lifecycle-of-a-refund>).\n   */\n  status?: StatusWithLiterals;\n  /**\n   * Status code.\n   * [Read more about reason codes.](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/reason-codes)\n   * @minLength 1\n   * @maxLength 10\n   */\n  statusCode?: string | null;\n  /**\n   * Currency of refund, should be the same as currency of charge.\n   * @format CURRENCY\n   */\n  currencyCode?: string | null;\n  /**\n   * Amount of refund in base units, what's returned to the buyer.\n   * E.g. \"12.95\".\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  amount?: string | null;\n  /**\n   * Application fee returned to merchant from Wix.\n   * Having this as a separate field since Refund.returned_application_fee is readOnly.\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  returnedApplicationFee?: string | null;\n  /**\n   * Reason why this refund was issued.\n   * @minLength 1\n   * @maxLength 1000\n   */\n  reason?: string | null;\n  /**\n   * Optional free-text note about this refund.\n   * @minLength 1\n   * @maxLength 200\n   */\n  note?: string | null;\n  /**\n   * Processing fee returned to merchant from Wix.\n   * Having this as a separate field since Refund.returned_processing_fee is readOnly.\n   * @decimalValue options { gt:0, maxScale:8 }\n   */\n  returnedProcessingFee?: string | null;\n  /**\n   * Unique number assigned to a refund. This number is shared across all parties involved in processing the refund. It allows the merchant to track the refund with their bank.\n   * @minLength 1\n   * @maxLength 30\n   */\n  acquirerReferenceNumber?: string | null;\n  /** Who initiated this refund. */\n  initiator?: InitiatorWithLiterals;\n}\n\nexport interface SyncRefundResponse {\n  /** Created/updated refund. */\n  refund?: Refund;\n}\n\n/** @docsIgnore */\nexport type CreateRefundApplicationErrors =\n  | {\n      code?: 'CHARGE_REFUNDED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'CHARGE_REFUND_IN_PROGRESS';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'CHARGE_DISPUTED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'CHARGE_REFUND_PERIOD_ENDED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'CHARGE_UNPAID';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PROVIDER_DOWN';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PROVIDER_NOT_SUPPORTED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PAYMENT_METHOD_NOT_SUPPORTED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'MERCHANT_BALANCE_INSUFFICIENT';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'ONLINE_REFUND_NOT_SUPPORTED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PARTIAL_REFUND_NOT_SUPPORTED';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'REFUND_AMOUNT_OUT_OF_BOUNDS';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'REFUND_CURRENCY_MISSING';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'REFUND_CURRENCY_MISMATCH';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH';\n      description?: string;\n      data?: Record<string, any>;\n    };\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface RefundCreatedEnvelope {\n  entity: Refund;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Refunds\n * @permissionScopeId SCOPE.DC-PAYMENTS.MANAGE-REFUNDS\n * @permissionScope Manage Payments - All Permissions\n * @permissionScopeId SCOPE.DC-PAYMENTS.MANAGE-PAYMENTS\n * @permissionScope Read Refunds\n * @permissionScopeId SCOPE.DC-PAYMENTS.READ-REFUNDS\n * @permissionId PAYMENTS.REFUND_READ\n * @webhook\n * @eventType wix.payments.refunds.v1.refund_created\n * @serviceIdentifier wix.payments.refunds.v1.RefundService\n * @slug created\n */\nexport declare function onRefundCreated(\n  handler: (event: RefundCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface RefundUpdatedEnvelope {\n  entity: Refund;\n  metadata: EventMetadata;\n  /** @hidden */\n  modifiedFields: Record<string, any>;\n}\n\n/** @permissionScope Manage Refunds\n * @permissionScopeId SCOPE.DC-PAYMENTS.MANAGE-REFUNDS\n * @permissionScope Manage Payments - All Permissions\n * @permissionScopeId SCOPE.DC-PAYMENTS.MANAGE-PAYMENTS\n * @permissionScope Read Refunds\n * @permissionScopeId SCOPE.DC-PAYMENTS.READ-REFUNDS\n * @permissionId PAYMENTS.REFUND_READ\n * @webhook\n * @eventType wix.payments.refunds.v1.refund_updated\n * @serviceIdentifier wix.payments.refunds.v1.RefundService\n * @slug updated\n */\nexport declare function onRefundUpdated(\n  handler: (event: RefundUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a refund.\n *\n * The refunding process starts immediately after a refund entity is created.\n *\n * If you specify an `amount`, you must also specify a `currency_code`. This currency should be the same as the currency of the charge.\n * If `amount` and `currency_code` are not specified, the refund is created for the full charge amount. If the charge was already partially refunded, this refund will fail.\n * @param refund - Refund to be created.\n * @public\n * @requiredField refund\n * @requiredField refund.chargeId\n * @permissionId PAYMENTS.REFUND_CREATE\n * @applicableIdentity APP\n * @returns The created refund.\n * @fqn wix.payments.refunds.v1.RefundService.CreateRefund\n */\nexport async function createRefund(\n  refund: NonNullablePaths<Refund, `chargeId`, 2>,\n  options?: CreateRefundOptions\n): Promise<\n  NonNullablePaths<Refund, `status` | `statusInfo.code`, 3> & {\n    __applicationErrorsType?: CreateRefundApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    refund: refund,\n    previouslyRefundedAmount: options?.previouslyRefundedAmount,\n  });\n\n  const reqOpts = ambassadorWixPaymentsRefundsV1Refund.createRefund(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.refund!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          refund: '$[0]',\n          previouslyRefundedAmount: '$[1].previouslyRefundedAmount',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['refund', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CreateRefundOptions {\n  /**\n   * Amount of the charge that was previously refunded.\n   *\n   * Specify this to compare your records of previously refunded amounts against those on the server. If they don't match, this method will return an error with the code `PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH`.\n   *\n   * Learn more about [preventing unintended refunds](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds).\n   * @decimalValue options { gte:0, maxScale:8 }\n   */\n  previouslyRefundedAmount?: string | null;\n}\n\n/**\n * Retrieves a refund.\n * @param refundId - ID of the refund to retrieve.\n * @public\n * @requiredField refundId\n * @permissionId PAYMENTS.REFUND_READ\n * @applicableIdentity APP\n * @returns The requested refund.\n * @fqn wix.payments.refunds.v1.RefundService.GetRefund\n */\nexport async function getRefund(\n  refundId: string\n): Promise<NonNullablePaths<Refund, `status` | `statusInfo.code`, 3>> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ refundId: refundId });\n\n  const reqOpts = ambassadorWixPaymentsRefundsV1Refund.getRefund(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.refund!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { refundId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['refundId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Creates a query to retrieve a list of refunds.\n *\n *\n * The `queryRefunds()` method builds a query to retrieve a list of refunds and returns a [RefundsQueryBuilder](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/ascending) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/find) method.\n *\n * You can refine the query by chaining `RefundsQueryBuilder` methods onto the query. `RefundsQueryBuilder` methods enable you to sort, filter, and control the results that `queryRefunds.find()` returns.\n *\n * The query runs with the following `RefundsQueryBuilder` defaults that you can override:\n *\n * - [`skipTo(0)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/skip-to)\n * - [`limit(50)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/limit)\n * - [`descending(\"_createdDate\")`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/descending)\n *\n * The methods that are chained to `queryRefunds()` are applied in the order they are called.\n *\n * The table below shows which `RefundsQueryBuilder` methods are supported for `queryRefunds()`. You can only use one filter method for each property. Only the first filter will work if a property is used in more than one filter.\n * @public\n * @permissionId PAYMENTS.REFUND_READ\n * @applicableIdentity APP\n * @fqn wix.payments.refunds.v1.RefundService.QueryRefunds\n */\nexport function queryRefunds(): RefundsQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    Refund,\n    'CURSOR',\n    QueryRefundsRequest,\n    QueryRefundsResponse\n  >({\n    func: async (payload: QueryRefundsRequest) => {\n      const reqOpts =\n        ambassadorWixPaymentsRefundsV1Refund.queryRefunds(payload);\n\n      sideEffects?.onSiteCall?.();\n      try {\n        const result = await httpClient.request(reqOpts);\n        sideEffects?.onSuccess?.(result);\n        return result;\n      } catch (err) {\n        sideEffects?.onError?.(err);\n        throw err;\n      }\n    },\n    requestTransformer: (query: QueryRefundsRequest['query']) => {\n      const args = [query, {}] as [QueryRefundsRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({ data }: HttpResponse<QueryRefundsResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.refunds,\n        pagingMetadata: transformedData?.pagingMetadata,\n      };\n    },\n    errorTransformer: (err: unknown) => {\n      const transformedError = sdkTransformError(err, {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      });\n\n      throw transformedError;\n    },\n    pagingMethod: 'CURSOR',\n    transformationPaths: {},\n  });\n}\n\ninterface QueryCursorResult {\n  cursors: Cursors;\n  hasNext: () => boolean;\n  hasPrev: () => boolean;\n  length: number;\n  pageSize: number;\n}\n\nexport interface RefundsQueryResult extends QueryCursorResult {\n  items: Refund[];\n  query: RefundsQueryBuilder;\n  next: () => Promise<RefundsQueryResult>;\n  prev: () => Promise<RefundsQueryResult>;\n}\n\nexport interface RefundsQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (propertyName: 'chargeId', value: any) => RefundsQueryBuilder;\n  in: (propertyName: 'chargeId', value: any) => RefundsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (...propertyNames: Array<'_createdDate'>) => RefundsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (...propertyNames: Array<'_createdDate'>) => RefundsQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => RefundsQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => RefundsQueryBuilder;\n  find: () => Promise<RefundsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.payments.refunds.v1.RefundService.QueryRefunds\n * @requiredField query\n * @returns A `RefundsQueryBuilder` object that contains the refined query.\n */\nexport async function typedQueryRefunds(\n  query: RefundQuery\n): Promise<\n  NonNullablePaths<\n    QueryRefundsResponse,\n    | `refunds`\n    | `refunds.${number}.status`\n    | `refunds.${number}.statusInfo.code`,\n    5\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n  const reqOpts = ambassadorWixPaymentsRefundsV1Refund.queryRefunds(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['query']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface RefundQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: ['chargeId'];\n      operators: ['$eq', '$in'];\n      sort: 'NONE';\n    },\n    {\n      fields: ['_createdDate'];\n      operators: [];\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n  Refund,\n  RefundQuerySpec\n>;\nexport type RefundQuery = {\n  /** \n  Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  \n  */\n  cursorPaging?: {\n    /** \n  Number of items to load. \n  @max: 100 \n  */\n    limit?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n      | null;\n    /** \n  Pointer to the next or previous page in the list of results.\n\n  You can get the relevant cursor token\n  from the `pagingMetadata` object in the previous call's response.\n  Not relevant for the first request. \n  @maxLength: 16000 \n  */\n    cursor?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n      | null;\n  };\n  /** \n  Filter object in the following format:\n  `\"filter\" : {\n  \"fieldName1\": \"value1\",\n  \"fieldName2\":{\"$operator\":\"value2\"}\n  }`\n  Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object in the following format:\n  `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n  @maxSize: 4 \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 64 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order.  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n  }[];\n};\n\nexport const utils = {\n  query: {\n    ...createQueryUtils<Refund, RefundQuerySpec, RefundQuery>(),\n  },\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsRefundsV1RefundServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/payments/refunds/v1',\n        destPath: '/v1',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/payments/refunds/v1/refunds',\n        destPath: '/v1/refunds',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/payments/refunds/v1/refunds',\n        destPath: '/v1/refunds',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/payments/refunds/v1/refunds',\n        destPath: '/v1/refunds',\n      },\n    ],\n    'manage.base44.com': [\n      {\n        srcPath: '/_api/refunds',\n        destPath: '',\n      },\n    ],\n    'payments.base44.com': [\n      {\n        srcPath: '/_api/refunds',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_refunds';\n\n/**\n * Creates a refund.\n *\n * The refunding process starts immediately after a refund entity is created.\n *\n * If you specify an `amount`, you must also specify a `currency_code`. This currency should be the same as the currency of the charge.\n * If `amount` and `currency_code` are not specified, the refund is created for the full charge amount. If the charge was already partially refunded, this refund will fail.\n */\nexport function createRefund(payload: object): RequestOptionsFactory<any> {\n  function __createRefund({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [{ path: 'refund.createdDate' }, { path: 'refund.updatedDate' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.payments.refunds.v1.refund',\n      method: 'POST' as any,\n      methodFqn: 'wix.payments.refunds.v1.RefundService.CreateRefund',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixPaymentsRefundsV1RefundServiceUrl({\n        protoPath: '/v1/refunds',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'refund.createdDate' },\n              { path: 'refund.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __createRefund;\n}\n\n/** Retrieves a refund. */\nexport function getRefund(payload: object): RequestOptionsFactory<any> {\n  function __getRefund({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.payments.refunds.v1.refund',\n      method: 'GET' as any,\n      methodFqn: 'wix.payments.refunds.v1.RefundService.GetRefund',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixPaymentsRefundsV1RefundServiceUrl({\n        protoPath: '/v1/refunds/{refundId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'refund.createdDate' },\n              { path: 'refund.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getRefund;\n}\n\n/**\n * Creates a query to retrieve a list of refunds.\n *\n *\n * The `queryRefunds()` method builds a query to retrieve a list of refunds and returns a [RefundsQueryBuilder](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/ascending) object.\n *\n * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/find) method.\n *\n * You can refine the query by chaining `RefundsQueryBuilder` methods onto the query. `RefundsQueryBuilder` methods enable you to sort, filter, and control the results that `queryRefunds.find()` returns.\n *\n * The query runs with the following `RefundsQueryBuilder` defaults that you can override:\n *\n * - [`skipTo(0)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/skip-to)\n * - [`limit(50)`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/limit)\n * - [`descending(\"_createdDate\")`](https://dev.wix.com/docs/sdk/backend-modules/payments/refunds/refunds-query-builder/descending)\n *\n * The methods that are chained to `queryRefunds()` are applied in the order they are called.\n *\n * The table below shows which `RefundsQueryBuilder` methods are supported for `queryRefunds()`. You can only use one filter method for each property. Only the first filter will work if a property is used in more than one filter.\n */\nexport function queryRefunds(payload: object): RequestOptionsFactory<any> {\n  function __queryRefunds({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.payments.refunds.v1.refund',\n      method: 'POST' as any,\n      methodFqn: 'wix.payments.refunds.v1.RefundService.QueryRefunds',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixPaymentsRefundsV1RefundServiceUrl({\n        protoPath: '/v1/refunds/query',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'refunds.createdDate' },\n              { path: 'refunds.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __queryRefunds;\n}\n","import {\n  createRefund as publicCreateRefund,\n  getRefund as publicGetRefund,\n  queryRefunds as publicQueryRefunds,\n  typedQueryRefunds as publicTypedQueryRefunds,\n} from './payments-refunds-v1-refund-refunds.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n  BuildRESTFunction,\n  MaybeContext,\n  BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n  RefundQuery,\n  RefundsQueryBuilder,\n  typedQueryRefunds as universalTypedQueryRefunds,\n} from './payments-refunds-v1-refund-refunds.universal.js';\nimport { onRefundCreated as publicOnRefundCreated } from './payments-refunds-v1-refund-refunds.public.js';\nimport { onRefundUpdated as publicOnRefundUpdated } from './payments-refunds-v1-refund-refunds.public.js';\n\nfunction customQueryRefunds(httpClient: HttpClient) {\n  const router = createQueryOverloadRouter({\n    builderQueryFunction: () => publicQueryRefunds(httpClient)(),\n    typedQueryFunction: (query: RefundQuery) =>\n      publicTypedQueryRefunds(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): RefundsQueryBuilder;\n  function overloadedQuery(\n    query: RefundQuery\n  ): ReturnType<typeof universalTypedQueryRefunds>;\n  function overloadedQuery(query?: RefundQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const createRefund: MaybeContext<\n  BuildRESTFunction<typeof publicCreateRefund> & typeof publicCreateRefund\n> = /*#__PURE__*/ createRESTModule(publicCreateRefund);\nexport const getRefund: MaybeContext<\n  BuildRESTFunction<typeof publicGetRefund> & typeof publicGetRefund\n> = /*#__PURE__*/ createRESTModule(publicGetRefund);\nexport const queryRefunds: MaybeContext<\n  BuildRESTFunction<typeof customQueryRefunds> & typeof customQueryRefunds\n> = /*#__PURE__*/ createRESTModule(customQueryRefunds);\n/** */\nexport const onRefundCreated: BuildEventDefinition<\n  typeof publicOnRefundCreated\n> &\n  typeof publicOnRefundCreated = createEventModule(publicOnRefundCreated);\n/** */\nexport const onRefundUpdated: BuildEventDefinition<\n  typeof publicOnRefundUpdated\n> &\n  typeof publicOnRefundUpdated = createEventModule(publicOnRefundUpdated);\n\nexport {\n  Status,\n  Initiator,\n  SortOrder,\n  RejectionReason,\n  WebhookIdentityType,\n} from './payments-refunds-v1-refund-refunds.universal.js';\nexport {\n  Refund,\n  ExtendedFields,\n  StatusInfo,\n  CreateRefundRequest,\n  CreateRefundResponse,\n  GetRefundRequest,\n  GetRefundResponse,\n  QueryRefundsRequest,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Sorting,\n  CursorPaging,\n  QueryRefundsResponse,\n  CursorPagingMetadata,\n  Cursors,\n  UpdateExtendedFieldsRequest,\n  UpdateExtendedFieldsResponse,\n  GetRefundabilityRequest,\n  GetRefundabilityResponse,\n  Refundability,\n  RefundabilityDetailsOneOf,\n  RefundDetails,\n  RejectionDetails,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  SyncRefundRequest,\n  SyncRefundResponse,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  RefundCreatedEnvelope,\n  RefundUpdatedEnvelope,\n  CreateRefundOptions,\n  RefundsQueryResult,\n  RefundsQueryBuilder,\n  RefundQuerySpec,\n} from './payments-refunds-v1-refund-refunds.universal.js';\nexport { utils } from './payments-refunds-v1-refund-refunds.universal.js';\nexport {\n  StatusWithLiterals,\n  InitiatorWithLiterals,\n  SortOrderWithLiterals,\n  RejectionReasonWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  CreateRefundApplicationErrors,\n  CommonQueryWithEntityContext,\n  RefundQuery,\n} from './payments-refunds-v1-refund-refunds.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,4CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MAC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hKzB,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAOlC,SAAS,iCAAiC;AAS1C,SAAS,mBAAmB,YAAwB;AAClD,QAAM,SAAS,0BAA0B;AAAA,IACvC,sBAAsB,MAAMC,cAAmB,UAAU,EAAE;AAAA,IAC3D,oBAAoB,CAAC,UACnBC,mBAAwB,UAAU,EAAE,KAAK;AAAA,IAC3C,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA0B;AACjD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,aAEK,iCAAiBA,UAAe;AAC3C,IAAMH,gBAEK,iCAAiB,kBAAkB;AAE9C,IAAMI,mBAGoB,kBAAkB,eAAqB;AAEjE,IAAMC,mBAGoB,kBAAkB,eAAqB;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","transformPaths","Status","Initiator","SortOrder","RejectionReason","WebhookIdentityType","createRefund","getRefund","queryRefunds","createRefund","getRefund","queryRefunds","typedQueryRefunds","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","queryRefunds","typedQueryRefunds","createRefund","getRefund","onRefundCreated","onRefundUpdated"]}