@wix/payments 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,47 @@
1
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
+ interface HttpClient {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6
+ }
7
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
+ type HttpResponse<T = any> = {
9
+ data: T;
10
+ status: number;
11
+ statusText: string;
12
+ headers: any;
13
+ request?: any;
14
+ };
15
+ type RequestOptions<_TResponse = any, Data = any> = {
16
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
+ url: string;
18
+ data?: Data;
19
+ params?: URLSearchParams;
20
+ } & APIMetadata;
21
+ type APIMetadata = {
22
+ methodFqn?: string;
23
+ entityFqdn?: string;
24
+ packageName?: string;
25
+ };
26
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
28
+ __type: 'event-definition';
29
+ type: Type;
30
+ isDomainEvent?: boolean;
31
+ transformations?: (envelope: unknown) => Payload;
32
+ __payload: Payload;
33
+ };
34
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
35
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
36
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
37
+
38
+ declare global {
39
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
40
+ interface SymbolConstructor {
41
+ readonly observable: symbol;
42
+ }
43
+ }
44
+
1
45
  interface OnboardingAvailability {
2
46
  /**
3
47
  * ID of this entity
@@ -323,98 +367,215 @@ interface UpdatePartnerFlowOptions {
323
367
  partnerFlow?: PartnerFlow;
324
368
  }
325
369
 
326
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
327
- interface HttpClient {
328
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
329
- fetchWithAuth: typeof fetch;
330
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
370
+ declare function getOnboardingAvailability$1(httpClient: HttpClient): GetOnboardingAvailabilitySignature;
371
+ interface GetOnboardingAvailabilitySignature {
372
+ /**
373
+ * Fetch current state of onboarding availability for meta site.
374
+ */
375
+ (): Promise<GetOnboardingAvailabilityResponse & GetOnboardingAvailabilityResponseNonNullableFields>;
331
376
  }
332
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
333
- type HttpResponse<T = any> = {
334
- data: T;
335
- status: number;
336
- statusText: string;
337
- headers: any;
338
- request?: any;
339
- };
340
- type RequestOptions<_TResponse = any, Data = any> = {
341
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
342
- url: string;
343
- data?: Data;
344
- params?: URLSearchParams;
345
- } & APIMetadata;
346
- type APIMetadata = {
347
- methodFqn?: string;
348
- entityFqdn?: string;
349
- packageName?: string;
350
- };
351
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
352
- type EventDefinition<Payload = unknown, Type extends string = string> = {
353
- __type: 'event-definition';
354
- type: Type;
355
- isDomainEvent?: boolean;
356
- transformations?: (envelope: unknown) => Payload;
357
- __payload: Payload;
358
- };
359
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
360
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
361
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
377
+ declare function updateCbdFlow$1(httpClient: HttpClient): UpdateCbdFlowSignature;
378
+ interface UpdateCbdFlowSignature {
379
+ /**
380
+ * Update current state of CBD flow for meta site.
381
+ */
382
+ (options?: UpdateCbdFlowOptions | undefined): Promise<UpdateCbdFlowResponse & UpdateCbdFlowResponseNonNullableFields>;
383
+ }
384
+ declare function updateRestrictedGoodsFlow$1(httpClient: HttpClient): UpdateRestrictedGoodsFlowSignature;
385
+ interface UpdateRestrictedGoodsFlowSignature {
386
+ /**
387
+ * Update current state of Restricted Goods flow for meta site.
388
+ */
389
+ (options?: UpdateRestrictedGoodsFlowOptions | undefined): Promise<UpdateRestrictedGoodsFlowResponse & UpdateRestrictedGoodsFlowResponseNonNullableFields>;
390
+ }
391
+ declare function updatePartnerFlow$1(httpClient: HttpClient): UpdatePartnerFlowSignature;
392
+ interface UpdatePartnerFlowSignature {
393
+ /**
394
+ * Update current state of partner flow for meta site.
395
+ */
396
+ (options?: UpdatePartnerFlowOptions | undefined): Promise<UpdatePartnerFlowResponse & UpdatePartnerFlowResponseNonNullableFields>;
397
+ }
398
+ declare const onOnboardingAvailabilityCreated$1: EventDefinition<OnboardingAvailabilityCreatedEnvelope, "wix.cashier.onboarding_availability.v1.onboarding_availability_created">;
399
+ declare const onOnboardingAvailabilityUpdated$1: EventDefinition<OnboardingAvailabilityUpdatedEnvelope, "wix.cashier.onboarding_availability.v1.onboarding_availability_updated">;
362
400
 
363
- declare global {
364
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
365
- interface SymbolConstructor {
366
- readonly observable: symbol;
367
- }
401
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
402
+
403
+ declare const getOnboardingAvailability: BuildRESTFunction<typeof getOnboardingAvailability$1> & typeof getOnboardingAvailability$1;
404
+ declare const updateCbdFlow: BuildRESTFunction<typeof updateCbdFlow$1> & typeof updateCbdFlow$1;
405
+ declare const updateRestrictedGoodsFlow: BuildRESTFunction<typeof updateRestrictedGoodsFlow$1> & typeof updateRestrictedGoodsFlow$1;
406
+ declare const updatePartnerFlow: BuildRESTFunction<typeof updatePartnerFlow$1> & typeof updatePartnerFlow$1;
407
+
408
+ type _publicOnOnboardingAvailabilityCreatedType = typeof onOnboardingAvailabilityCreated$1;
409
+ /** */
410
+ declare const onOnboardingAvailabilityCreated: ReturnType<typeof createEventModule$1<_publicOnOnboardingAvailabilityCreatedType>>;
411
+
412
+ type _publicOnOnboardingAvailabilityUpdatedType = typeof onOnboardingAvailabilityUpdated$1;
413
+ /** */
414
+ declare const onOnboardingAvailabilityUpdated: ReturnType<typeof createEventModule$1<_publicOnOnboardingAvailabilityUpdatedType>>;
415
+
416
+ type context$2_AttestationInfo = AttestationInfo;
417
+ type context$2_CbdFlow = CbdFlow;
418
+ type context$2_GetOnboardingAvailabilityRequest = GetOnboardingAvailabilityRequest;
419
+ type context$2_GetOnboardingAvailabilityResponse = GetOnboardingAvailabilityResponse;
420
+ type context$2_GetOnboardingAvailabilityResponseNonNullableFields = GetOnboardingAvailabilityResponseNonNullableFields;
421
+ type context$2_OnboardingAvailability = OnboardingAvailability;
422
+ type context$2_OnboardingAvailabilityCreatedEnvelope = OnboardingAvailabilityCreatedEnvelope;
423
+ type context$2_OnboardingAvailabilityUpdatedEnvelope = OnboardingAvailabilityUpdatedEnvelope;
424
+ type context$2_PartnerFlow = PartnerFlow;
425
+ type context$2_PartnerFlowStatus = PartnerFlowStatus;
426
+ declare const context$2_PartnerFlowStatus: typeof PartnerFlowStatus;
427
+ type context$2_RestoreInfo = RestoreInfo;
428
+ type context$2_RestrictedGoodsCategory = RestrictedGoodsCategory;
429
+ declare const context$2_RestrictedGoodsCategory: typeof RestrictedGoodsCategory;
430
+ type context$2_RestrictedGoodsFlow = RestrictedGoodsFlow;
431
+ type context$2_RestrictedGoodsFlowStatus = RestrictedGoodsFlowStatus;
432
+ declare const context$2_RestrictedGoodsFlowStatus: typeof RestrictedGoodsFlowStatus;
433
+ type context$2_UpdateCbdFlowOptions = UpdateCbdFlowOptions;
434
+ type context$2_UpdateCbdFlowRequest = UpdateCbdFlowRequest;
435
+ type context$2_UpdateCbdFlowResponse = UpdateCbdFlowResponse;
436
+ type context$2_UpdateCbdFlowResponseNonNullableFields = UpdateCbdFlowResponseNonNullableFields;
437
+ type context$2_UpdatePartnerFlowOptions = UpdatePartnerFlowOptions;
438
+ type context$2_UpdatePartnerFlowRequest = UpdatePartnerFlowRequest;
439
+ type context$2_UpdatePartnerFlowResponse = UpdatePartnerFlowResponse;
440
+ type context$2_UpdatePartnerFlowResponseNonNullableFields = UpdatePartnerFlowResponseNonNullableFields;
441
+ type context$2_UpdateRestrictedGoodsFlowOptions = UpdateRestrictedGoodsFlowOptions;
442
+ type context$2_UpdateRestrictedGoodsFlowRequest = UpdateRestrictedGoodsFlowRequest;
443
+ type context$2_UpdateRestrictedGoodsFlowResponse = UpdateRestrictedGoodsFlowResponse;
444
+ type context$2_UpdateRestrictedGoodsFlowResponseNonNullableFields = UpdateRestrictedGoodsFlowResponseNonNullableFields;
445
+ type context$2__publicOnOnboardingAvailabilityCreatedType = _publicOnOnboardingAvailabilityCreatedType;
446
+ type context$2__publicOnOnboardingAvailabilityUpdatedType = _publicOnOnboardingAvailabilityUpdatedType;
447
+ declare const context$2_getOnboardingAvailability: typeof getOnboardingAvailability;
448
+ declare const context$2_onOnboardingAvailabilityCreated: typeof onOnboardingAvailabilityCreated;
449
+ declare const context$2_onOnboardingAvailabilityUpdated: typeof onOnboardingAvailabilityUpdated;
450
+ declare const context$2_updateCbdFlow: typeof updateCbdFlow;
451
+ declare const context$2_updatePartnerFlow: typeof updatePartnerFlow;
452
+ declare const context$2_updateRestrictedGoodsFlow: typeof updateRestrictedGoodsFlow;
453
+ declare namespace context$2 {
454
+ export { type ActionEvent$1 as ActionEvent, type context$2_AttestationInfo as AttestationInfo, type BaseEventMetadata$1 as BaseEventMetadata, type context$2_CbdFlow as CbdFlow, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$2_GetOnboardingAvailabilityRequest as GetOnboardingAvailabilityRequest, type context$2_GetOnboardingAvailabilityResponse as GetOnboardingAvailabilityResponse, type context$2_GetOnboardingAvailabilityResponseNonNullableFields as GetOnboardingAvailabilityResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type context$2_OnboardingAvailability as OnboardingAvailability, type context$2_OnboardingAvailabilityCreatedEnvelope as OnboardingAvailabilityCreatedEnvelope, type context$2_OnboardingAvailabilityUpdatedEnvelope as OnboardingAvailabilityUpdatedEnvelope, type context$2_PartnerFlow as PartnerFlow, context$2_PartnerFlowStatus as PartnerFlowStatus, type context$2_RestoreInfo as RestoreInfo, context$2_RestrictedGoodsCategory as RestrictedGoodsCategory, type context$2_RestrictedGoodsFlow as RestrictedGoodsFlow, context$2_RestrictedGoodsFlowStatus as RestrictedGoodsFlowStatus, Status$1 as Status, type context$2_UpdateCbdFlowOptions as UpdateCbdFlowOptions, type context$2_UpdateCbdFlowRequest as UpdateCbdFlowRequest, type context$2_UpdateCbdFlowResponse as UpdateCbdFlowResponse, type context$2_UpdateCbdFlowResponseNonNullableFields as UpdateCbdFlowResponseNonNullableFields, type context$2_UpdatePartnerFlowOptions as UpdatePartnerFlowOptions, type context$2_UpdatePartnerFlowRequest as UpdatePartnerFlowRequest, type context$2_UpdatePartnerFlowResponse as UpdatePartnerFlowResponse, type context$2_UpdatePartnerFlowResponseNonNullableFields as UpdatePartnerFlowResponseNonNullableFields, type context$2_UpdateRestrictedGoodsFlowOptions as UpdateRestrictedGoodsFlowOptions, type context$2_UpdateRestrictedGoodsFlowRequest as UpdateRestrictedGoodsFlowRequest, type context$2_UpdateRestrictedGoodsFlowResponse as UpdateRestrictedGoodsFlowResponse, type context$2_UpdateRestrictedGoodsFlowResponseNonNullableFields as UpdateRestrictedGoodsFlowResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, type context$2__publicOnOnboardingAvailabilityCreatedType as _publicOnOnboardingAvailabilityCreatedType, type context$2__publicOnOnboardingAvailabilityUpdatedType as _publicOnOnboardingAvailabilityUpdatedType, context$2_getOnboardingAvailability as getOnboardingAvailability, context$2_onOnboardingAvailabilityCreated as onOnboardingAvailabilityCreated, context$2_onOnboardingAvailabilityUpdated as onOnboardingAvailabilityUpdated, onOnboardingAvailabilityCreated$1 as publicOnOnboardingAvailabilityCreated, onOnboardingAvailabilityUpdated$1 as publicOnOnboardingAvailabilityUpdated, context$2_updateCbdFlow as updateCbdFlow, context$2_updatePartnerFlow as updatePartnerFlow, context$2_updateRestrictedGoodsFlow as updateRestrictedGoodsFlow };
368
455
  }
369
456
 
370
- declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
457
+ /** Provider platform event */
458
+ interface ProviderPlatformEvent extends ProviderPlatformEventResourceOneOf {
459
+ /** Refund event data. */
460
+ refund?: RefundEvent;
461
+ /** Transaction event data. */
462
+ transaction?: TransactionEvent;
463
+ /**
464
+ * This field is ignored, do not send it.
465
+ * @deprecated
466
+ */
467
+ pluginId?: string;
468
+ }
469
+ /** @oneof */
470
+ interface ProviderPlatformEventResourceOneOf {
471
+ /** Refund event data. */
472
+ refund?: RefundEvent;
473
+ /** Transaction event data. */
474
+ transaction?: TransactionEvent;
475
+ }
476
+ interface RefundEvent {
477
+ /** Wix transaction ID. */
478
+ wixTransactionId?: string;
479
+ /** PSP refund ID. */
480
+ pluginRefundId?: string;
481
+ /** Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request. */
482
+ reasonCode?: number;
483
+ /** Refunded amount. */
484
+ amount?: string;
485
+ /** Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard. */
486
+ wixRefundId?: string | null;
487
+ /** PSP-specific error code. */
488
+ errorCode?: string | null;
489
+ /** PSP-specific error message. */
490
+ errorMessage?: string | null;
491
+ }
492
+ interface TransactionEvent {
493
+ /** Wix transaction ID. */
494
+ wixTransactionId?: string;
495
+ /** PSP transaction ID. */
496
+ pluginTransactionId?: string;
497
+ /** Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request. */
498
+ reasonCode?: number;
499
+ /** PSP-specific error code. */
500
+ errorCode?: string | null;
501
+ /** PSP-specific error message. */
502
+ errorMessage?: string | null;
503
+ /** Token data for stored payment method. */
504
+ credentialsOnFile?: CredentialsOnFile;
505
+ /** Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN. */
506
+ cardDetails?: CardDetails;
507
+ }
508
+ interface CredentialsOnFile extends CredentialsOnFileInfoOneOf {
509
+ /** Network token data. */
510
+ cardReference?: CardReference;
511
+ /** Provider generated token data. */
512
+ paymentMethodReference?: PaymentMethodReference;
513
+ }
514
+ /** @oneof */
515
+ interface CredentialsOnFileInfoOneOf {
516
+ /** Network token data. */
517
+ cardReference?: CardReference;
518
+ /** Provider generated token data. */
519
+ paymentMethodReference?: PaymentMethodReference;
520
+ }
521
+ interface CardReference {
522
+ /** Network token. */
523
+ networkTransactionId?: string;
524
+ /** Directory Server transaction ID */
525
+ dsTransactionId?: string | null;
526
+ }
527
+ interface PaymentMethodReference {
528
+ /** Payment method token created by the PSP. */
529
+ token?: string;
530
+ }
531
+ interface CardDetails {
532
+ /** Issuer (business) identification number. First 6 or 8 digits of the card's number. */
533
+ bin?: string | null;
534
+ /** Last 4 digits of the card's number. */
535
+ lastFour?: string | null;
536
+ }
537
+ /** Submit event request */
538
+ interface SubmitEventRequest {
539
+ /** Event data. */
540
+ event: ProviderPlatformEvent;
541
+ }
542
+ /** Submit event response */
543
+ interface SubmitEventResponse {
544
+ }
371
545
 
372
- declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
546
+ declare function submitEvent$1(httpClient: HttpClient): SubmitEventSignature;
547
+ interface SubmitEventSignature {
548
+ /**
549
+ * This Wix API is used by a Payment Service Provider (PSP) to send webhooks about payment and refund states to Wix.
550
+ *
551
+ * Calls to this endpoint must include a `User-Agent` header with the name of the PSP and the integration version in this format: `{PSP}/{version}`.
552
+ * PSP's create their own version numbers.
553
+ *
554
+ * > You cannot try out this endpoint because an `Authorization` header value has to be obtained
555
+ * > with the OAuth 2.0 client credentials flow for a specific scope.
556
+ * > So please ignore the **Authorization** section below as well as the **Try It Out** button.
557
+ * @param - Event data.
558
+ * @returns Submit event response
559
+ */
560
+ (event: ProviderPlatformEvent): Promise<void>;
561
+ }
373
562
 
374
- declare const getOnboardingAvailability: ReturnType<typeof createRESTModule$1<typeof publicGetOnboardingAvailability>>;
375
- declare const updateCbdFlow: ReturnType<typeof createRESTModule$1<typeof publicUpdateCbdFlow>>;
376
- declare const updateRestrictedGoodsFlow: ReturnType<typeof createRESTModule$1<typeof publicUpdateRestrictedGoodsFlow>>;
377
- declare const updatePartnerFlow: ReturnType<typeof createRESTModule$1<typeof publicUpdatePartnerFlow>>;
378
- declare const onOnboardingAvailabilityCreated: ReturnType<typeof createEventModule$1<typeof publicOnOnboardingAvailabilityCreated>>;
379
- declare const onOnboardingAvailabilityUpdated: ReturnType<typeof createEventModule$1<typeof publicOnOnboardingAvailabilityUpdated>>;
563
+ declare const submitEvent: BuildRESTFunction<typeof submitEvent$1> & typeof submitEvent$1;
380
564
 
381
- type context$1_AttestationInfo = AttestationInfo;
382
- type context$1_CbdFlow = CbdFlow;
383
- type context$1_GetOnboardingAvailabilityRequest = GetOnboardingAvailabilityRequest;
384
- type context$1_GetOnboardingAvailabilityResponse = GetOnboardingAvailabilityResponse;
385
- type context$1_GetOnboardingAvailabilityResponseNonNullableFields = GetOnboardingAvailabilityResponseNonNullableFields;
386
- type context$1_OnboardingAvailability = OnboardingAvailability;
387
- type context$1_OnboardingAvailabilityCreatedEnvelope = OnboardingAvailabilityCreatedEnvelope;
388
- type context$1_OnboardingAvailabilityUpdatedEnvelope = OnboardingAvailabilityUpdatedEnvelope;
389
- type context$1_PartnerFlow = PartnerFlow;
390
- type context$1_PartnerFlowStatus = PartnerFlowStatus;
391
- declare const context$1_PartnerFlowStatus: typeof PartnerFlowStatus;
392
- type context$1_RestoreInfo = RestoreInfo;
393
- type context$1_RestrictedGoodsCategory = RestrictedGoodsCategory;
394
- declare const context$1_RestrictedGoodsCategory: typeof RestrictedGoodsCategory;
395
- type context$1_RestrictedGoodsFlow = RestrictedGoodsFlow;
396
- type context$1_RestrictedGoodsFlowStatus = RestrictedGoodsFlowStatus;
397
- declare const context$1_RestrictedGoodsFlowStatus: typeof RestrictedGoodsFlowStatus;
398
- type context$1_UpdateCbdFlowOptions = UpdateCbdFlowOptions;
399
- type context$1_UpdateCbdFlowRequest = UpdateCbdFlowRequest;
400
- type context$1_UpdateCbdFlowResponse = UpdateCbdFlowResponse;
401
- type context$1_UpdateCbdFlowResponseNonNullableFields = UpdateCbdFlowResponseNonNullableFields;
402
- type context$1_UpdatePartnerFlowOptions = UpdatePartnerFlowOptions;
403
- type context$1_UpdatePartnerFlowRequest = UpdatePartnerFlowRequest;
404
- type context$1_UpdatePartnerFlowResponse = UpdatePartnerFlowResponse;
405
- type context$1_UpdatePartnerFlowResponseNonNullableFields = UpdatePartnerFlowResponseNonNullableFields;
406
- type context$1_UpdateRestrictedGoodsFlowOptions = UpdateRestrictedGoodsFlowOptions;
407
- type context$1_UpdateRestrictedGoodsFlowRequest = UpdateRestrictedGoodsFlowRequest;
408
- type context$1_UpdateRestrictedGoodsFlowResponse = UpdateRestrictedGoodsFlowResponse;
409
- type context$1_UpdateRestrictedGoodsFlowResponseNonNullableFields = UpdateRestrictedGoodsFlowResponseNonNullableFields;
410
- declare const context$1_getOnboardingAvailability: typeof getOnboardingAvailability;
411
- declare const context$1_onOnboardingAvailabilityCreated: typeof onOnboardingAvailabilityCreated;
412
- declare const context$1_onOnboardingAvailabilityUpdated: typeof onOnboardingAvailabilityUpdated;
413
- declare const context$1_updateCbdFlow: typeof updateCbdFlow;
414
- declare const context$1_updatePartnerFlow: typeof updatePartnerFlow;
415
- declare const context$1_updateRestrictedGoodsFlow: typeof updateRestrictedGoodsFlow;
565
+ type context$1_CardDetails = CardDetails;
566
+ type context$1_CardReference = CardReference;
567
+ type context$1_CredentialsOnFile = CredentialsOnFile;
568
+ type context$1_CredentialsOnFileInfoOneOf = CredentialsOnFileInfoOneOf;
569
+ type context$1_PaymentMethodReference = PaymentMethodReference;
570
+ type context$1_ProviderPlatformEvent = ProviderPlatformEvent;
571
+ type context$1_ProviderPlatformEventResourceOneOf = ProviderPlatformEventResourceOneOf;
572
+ type context$1_RefundEvent = RefundEvent;
573
+ type context$1_SubmitEventRequest = SubmitEventRequest;
574
+ type context$1_SubmitEventResponse = SubmitEventResponse;
575
+ type context$1_TransactionEvent = TransactionEvent;
576
+ declare const context$1_submitEvent: typeof submitEvent;
416
577
  declare namespace context$1 {
417
- export { type ActionEvent$1 as ActionEvent, type context$1_AttestationInfo as AttestationInfo, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_CbdFlow as CbdFlow, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_GetOnboardingAvailabilityRequest as GetOnboardingAvailabilityRequest, type context$1_GetOnboardingAvailabilityResponse as GetOnboardingAvailabilityResponse, type context$1_GetOnboardingAvailabilityResponseNonNullableFields as GetOnboardingAvailabilityResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type context$1_OnboardingAvailability as OnboardingAvailability, type context$1_OnboardingAvailabilityCreatedEnvelope as OnboardingAvailabilityCreatedEnvelope, type context$1_OnboardingAvailabilityUpdatedEnvelope as OnboardingAvailabilityUpdatedEnvelope, type context$1_PartnerFlow as PartnerFlow, context$1_PartnerFlowStatus as PartnerFlowStatus, type context$1_RestoreInfo as RestoreInfo, context$1_RestrictedGoodsCategory as RestrictedGoodsCategory, type context$1_RestrictedGoodsFlow as RestrictedGoodsFlow, context$1_RestrictedGoodsFlowStatus as RestrictedGoodsFlowStatus, Status$1 as Status, type context$1_UpdateCbdFlowOptions as UpdateCbdFlowOptions, type context$1_UpdateCbdFlowRequest as UpdateCbdFlowRequest, type context$1_UpdateCbdFlowResponse as UpdateCbdFlowResponse, type context$1_UpdateCbdFlowResponseNonNullableFields as UpdateCbdFlowResponseNonNullableFields, type context$1_UpdatePartnerFlowOptions as UpdatePartnerFlowOptions, type context$1_UpdatePartnerFlowRequest as UpdatePartnerFlowRequest, type context$1_UpdatePartnerFlowResponse as UpdatePartnerFlowResponse, type context$1_UpdatePartnerFlowResponseNonNullableFields as UpdatePartnerFlowResponseNonNullableFields, type context$1_UpdateRestrictedGoodsFlowOptions as UpdateRestrictedGoodsFlowOptions, type context$1_UpdateRestrictedGoodsFlowRequest as UpdateRestrictedGoodsFlowRequest, type context$1_UpdateRestrictedGoodsFlowResponse as UpdateRestrictedGoodsFlowResponse, type context$1_UpdateRestrictedGoodsFlowResponseNonNullableFields as UpdateRestrictedGoodsFlowResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, context$1_getOnboardingAvailability as getOnboardingAvailability, context$1_onOnboardingAvailabilityCreated as onOnboardingAvailabilityCreated, context$1_onOnboardingAvailabilityUpdated as onOnboardingAvailabilityUpdated, context$1_updateCbdFlow as updateCbdFlow, context$1_updatePartnerFlow as updatePartnerFlow, context$1_updateRestrictedGoodsFlow as updateRestrictedGoodsFlow };
578
+ export { type context$1_CardDetails as CardDetails, type context$1_CardReference as CardReference, type context$1_CredentialsOnFile as CredentialsOnFile, type context$1_CredentialsOnFileInfoOneOf as CredentialsOnFileInfoOneOf, type context$1_PaymentMethodReference as PaymentMethodReference, type context$1_ProviderPlatformEvent as ProviderPlatformEvent, type context$1_ProviderPlatformEventResourceOneOf as ProviderPlatformEventResourceOneOf, type context$1_RefundEvent as RefundEvent, type context$1_SubmitEventRequest as SubmitEventRequest, type context$1_SubmitEventResponse as SubmitEventResponse, type context$1_TransactionEvent as TransactionEvent, context$1_submitEvent as submitEvent };
418
579
  }
419
580
 
420
581
  /**
@@ -1031,17 +1192,86 @@ interface UpdateExtendedFieldsOptions {
1031
1192
  namespaceData: Record<string, any> | null;
1032
1193
  }
1033
1194
 
1034
- declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1195
+ declare function createRefund$1(httpClient: HttpClient): CreateRefundSignature;
1196
+ interface CreateRefundSignature {
1197
+ /**
1198
+ * Creates a refund.
1199
+ * Refunding process starts immediately after refund entity is created.
1200
+ *
1201
+ * If amount and currency are not specified,
1202
+ * refund is created for full charge amount.
1203
+ * If amount is specified, you also need to specify currency,
1204
+ * and it should be the same as charge currency.
1205
+ *
1206
+ * The call blocks until refund status transitions from `STARTING`.
1207
+ * Read more about refund statuses in this
1208
+ * [article](<https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#lifecycle-of-a-refund>).
1209
+ * @param - Refund to be created.
1210
+ * @returns The created refund.
1211
+ */
1212
+ (refund: Refund, options?: CreateRefundOptions | undefined): Promise<Refund & RefundNonNullableFields>;
1213
+ }
1214
+ declare function getRefund$1(httpClient: HttpClient): GetRefundSignature;
1215
+ interface GetRefundSignature {
1216
+ /**
1217
+ * Retrieves a refund.
1218
+ * @param - ID of the refund to retrieve.
1219
+ * @returns The requested refund.
1220
+ */
1221
+ (refundId: string): Promise<Refund & RefundNonNullableFields>;
1222
+ }
1223
+ declare function queryRefunds$1(httpClient: HttpClient): QueryRefundsSignature;
1224
+ interface QueryRefundsSignature {
1225
+ /**
1226
+ * Retrieves a list of refunds, given the provided [paging, filtering, and sorting][1].
1227
+ *
1228
+ * Up to 1,000 Refunds can be returned per request.
1229
+ *
1230
+ * To learn how to query refunds, see [API Query Language][2].
1231
+ *
1232
+ * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
1233
+ * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
1234
+ */
1235
+ (): RefundsQueryBuilder;
1236
+ }
1237
+ declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
1238
+ interface UpdateExtendedFieldsSignature {
1239
+ /**
1240
+ * Updates extended fields of a refund without incrementing revision.
1241
+ * @param - ID of the entity to update.
1242
+ * @param - Identifier for the app whose extended fields are being updated.
1243
+ */
1244
+ (_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise<UpdateExtendedFieldsResponse & UpdateExtendedFieldsResponseNonNullableFields>;
1245
+ }
1246
+ declare function getRefundability$1(httpClient: HttpClient): GetRefundabilitySignature;
1247
+ interface GetRefundabilitySignature {
1248
+ /**
1249
+ * Calculates refundability for a charge.
1250
+ *
1251
+ * Read more about refundability in this
1252
+ * [article](<https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#refundability>).
1253
+ * @param - ID of the charge for which refundability will be calculated.
1254
+ */
1255
+ (chargeId: string): Promise<GetRefundabilityResponse & GetRefundabilityResponseNonNullableFields>;
1256
+ }
1257
+ declare const onRefundCreated$1: EventDefinition<RefundCreatedEnvelope, "wix.payments.refunds.v1.refund_created">;
1258
+ declare const onRefundUpdated$1: EventDefinition<RefundUpdatedEnvelope, "wix.payments.refunds.v1.refund_updated">;
1035
1259
 
1036
1260
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1037
1261
 
1038
- declare const createRefund: ReturnType<typeof createRESTModule<typeof publicCreateRefund>>;
1039
- declare const getRefund: ReturnType<typeof createRESTModule<typeof publicGetRefund>>;
1040
- declare const queryRefunds: ReturnType<typeof createRESTModule<typeof publicQueryRefunds>>;
1041
- declare const updateExtendedFields: ReturnType<typeof createRESTModule<typeof publicUpdateExtendedFields>>;
1042
- declare const getRefundability: ReturnType<typeof createRESTModule<typeof publicGetRefundability>>;
1043
- declare const onRefundCreated: ReturnType<typeof createEventModule<typeof publicOnRefundCreated>>;
1044
- declare const onRefundUpdated: ReturnType<typeof createEventModule<typeof publicOnRefundUpdated>>;
1262
+ declare const createRefund: BuildRESTFunction<typeof createRefund$1> & typeof createRefund$1;
1263
+ declare const getRefund: BuildRESTFunction<typeof getRefund$1> & typeof getRefund$1;
1264
+ declare const queryRefunds: BuildRESTFunction<typeof queryRefunds$1> & typeof queryRefunds$1;
1265
+ declare const updateExtendedFields: BuildRESTFunction<typeof updateExtendedFields$1> & typeof updateExtendedFields$1;
1266
+ declare const getRefundability: BuildRESTFunction<typeof getRefundability$1> & typeof getRefundability$1;
1267
+
1268
+ type _publicOnRefundCreatedType = typeof onRefundCreated$1;
1269
+ /** */
1270
+ declare const onRefundCreated: ReturnType<typeof createEventModule<_publicOnRefundCreatedType>>;
1271
+
1272
+ type _publicOnRefundUpdatedType = typeof onRefundUpdated$1;
1273
+ /** */
1274
+ declare const onRefundUpdated: ReturnType<typeof createEventModule<_publicOnRefundUpdatedType>>;
1045
1275
 
1046
1276
  type context_ActionEvent = ActionEvent;
1047
1277
  type context_BaseEventMetadata = BaseEventMetadata;
@@ -1101,6 +1331,8 @@ type context_UpdateExtendedFieldsResponse = UpdateExtendedFieldsResponse;
1101
1331
  type context_UpdateExtendedFieldsResponseNonNullableFields = UpdateExtendedFieldsResponseNonNullableFields;
1102
1332
  type context_WebhookIdentityType = WebhookIdentityType;
1103
1333
  declare const context_WebhookIdentityType: typeof WebhookIdentityType;
1334
+ type context__publicOnRefundCreatedType = _publicOnRefundCreatedType;
1335
+ type context__publicOnRefundUpdatedType = _publicOnRefundUpdatedType;
1104
1336
  declare const context_createRefund: typeof createRefund;
1105
1337
  declare const context_getRefund: typeof getRefund;
1106
1338
  declare const context_getRefundability: typeof getRefundability;
@@ -1109,7 +1341,7 @@ declare const context_onRefundUpdated: typeof onRefundUpdated;
1109
1341
  declare const context_queryRefunds: typeof queryRefunds;
1110
1342
  declare const context_updateExtendedFields: typeof updateExtendedFields;
1111
1343
  declare namespace context {
1112
- export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_CreateRefundOptions as CreateRefundOptions, type context_CreateRefundRequest as CreateRefundRequest, type context_CreateRefundResponse as CreateRefundResponse, type context_CreateRefundResponseNonNullableFields as CreateRefundResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_ExtendedFields as ExtendedFields, type context_GetRefundRequest as GetRefundRequest, type context_GetRefundResponse as GetRefundResponse, type context_GetRefundResponseNonNullableFields as GetRefundResponseNonNullableFields, type context_GetRefundabilityRequest as GetRefundabilityRequest, type context_GetRefundabilityResponse as GetRefundabilityResponse, type context_GetRefundabilityResponseNonNullableFields as GetRefundabilityResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_Initiator as Initiator, type context_MessageEnvelope as MessageEnvelope, type context_QueryRefundsRequest as QueryRefundsRequest, type context_QueryRefundsResponse as QueryRefundsResponse, type context_QueryRefundsResponseNonNullableFields as QueryRefundsResponseNonNullableFields, type context_Refund as Refund, type context_RefundCreatedEnvelope as RefundCreatedEnvelope, type context_RefundNonNullableFields as RefundNonNullableFields, type context_RefundOptions as RefundOptions, type context_RefundUpdatedEnvelope as RefundUpdatedEnvelope, type context_Refundability as Refundability, type context_RefundabilityDetailsOneOf as RefundabilityDetailsOneOf, type context_RefundsQueryBuilder as RefundsQueryBuilder, type context_RefundsQueryResult as RefundsQueryResult, type context_Rejection as Rejection, context_RejectionReason as RejectionReason, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_Status as Status, type context_StatusInfo as StatusInfo, type context_SyncRefundRequest as SyncRefundRequest, type context_SyncRefundResponse as SyncRefundResponse, type context_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type context_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type context_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type context_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, context_createRefund as createRefund, context_getRefund as getRefund, context_getRefundability as getRefundability, context_onRefundCreated as onRefundCreated, context_onRefundUpdated as onRefundUpdated, context_queryRefunds as queryRefunds, context_updateExtendedFields as updateExtendedFields };
1344
+ export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_CreateRefundOptions as CreateRefundOptions, type context_CreateRefundRequest as CreateRefundRequest, type context_CreateRefundResponse as CreateRefundResponse, type context_CreateRefundResponseNonNullableFields as CreateRefundResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_ExtendedFields as ExtendedFields, type context_GetRefundRequest as GetRefundRequest, type context_GetRefundResponse as GetRefundResponse, type context_GetRefundResponseNonNullableFields as GetRefundResponseNonNullableFields, type context_GetRefundabilityRequest as GetRefundabilityRequest, type context_GetRefundabilityResponse as GetRefundabilityResponse, type context_GetRefundabilityResponseNonNullableFields as GetRefundabilityResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_Initiator as Initiator, type context_MessageEnvelope as MessageEnvelope, type context_QueryRefundsRequest as QueryRefundsRequest, type context_QueryRefundsResponse as QueryRefundsResponse, type context_QueryRefundsResponseNonNullableFields as QueryRefundsResponseNonNullableFields, type context_Refund as Refund, type context_RefundCreatedEnvelope as RefundCreatedEnvelope, type context_RefundNonNullableFields as RefundNonNullableFields, type context_RefundOptions as RefundOptions, type context_RefundUpdatedEnvelope as RefundUpdatedEnvelope, type context_Refundability as Refundability, type context_RefundabilityDetailsOneOf as RefundabilityDetailsOneOf, type context_RefundsQueryBuilder as RefundsQueryBuilder, type context_RefundsQueryResult as RefundsQueryResult, type context_Rejection as Rejection, context_RejectionReason as RejectionReason, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_Status as Status, type context_StatusInfo as StatusInfo, type context_SyncRefundRequest as SyncRefundRequest, type context_SyncRefundResponse as SyncRefundResponse, type context_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type context_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type context_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type context_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnRefundCreatedType as _publicOnRefundCreatedType, type context__publicOnRefundUpdatedType as _publicOnRefundUpdatedType, context_createRefund as createRefund, context_getRefund as getRefund, context_getRefundability as getRefundability, context_onRefundCreated as onRefundCreated, context_onRefundUpdated as onRefundUpdated, onRefundCreated$1 as publicOnRefundCreated, onRefundUpdated$1 as publicOnRefundUpdated, context_queryRefunds as queryRefunds, context_updateExtendedFields as updateExtendedFields };
1113
1345
  }
1114
1346
 
1115
- export { context$1 as onboardingAvailability, context as refunds };
1347
+ export { context$1 as callbacks, context$2 as onboardingAvailability, context as refunds };