@wix/auto_sdk_ecom_order-payment-requests 1.0.60 → 1.0.62
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.
- package/build/cjs/index.d.ts +33 -16
- package/build/cjs/index.js +100 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +171 -61
- package/build/cjs/index.typings.js +91 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +116 -35
- package/build/cjs/meta.js +65 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +5 -1
- package/build/cjs/schemas.js +116 -117
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +33 -16
- package/build/es/index.mjs +99 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +171 -61
- package/build/es/index.typings.mjs +90 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +116 -35
- package/build/es/meta.mjs +64 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +5 -1
- package/build/es/schemas.mjs +113 -116
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +40 -18
- package/build/internal/cjs/index.js +100 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +187 -71
- package/build/internal/cjs/index.typings.js +91 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +116 -35
- package/build/internal/cjs/meta.js +65 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +5 -1
- package/build/internal/cjs/schemas.js +116 -117
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +40 -18
- package/build/internal/es/index.mjs +99 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +187 -71
- package/build/internal/es/index.typings.mjs +90 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +116 -35
- package/build/internal/es/meta.mjs +64 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +5 -1
- package/build/internal/es/schemas.mjs +113 -116
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ interface OrderPaymentRequest {
|
|
|
9
9
|
*/
|
|
10
10
|
_id?: string | null;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Details about the source that created the order payment request.
|
|
13
13
|
* @immutable
|
|
14
14
|
*/
|
|
15
15
|
source?: Source;
|
|
@@ -36,43 +36,47 @@ interface OrderPaymentRequest {
|
|
|
36
36
|
*/
|
|
37
37
|
amount?: Price;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.
|
|
40
40
|
* @format CURRENCY
|
|
41
41
|
* @readonly
|
|
42
42
|
*/
|
|
43
43
|
currency?: string;
|
|
44
44
|
/**
|
|
45
|
-
* Payment gateway order
|
|
45
|
+
* Payment gateway order ID associated with this payment request.
|
|
46
46
|
* @readonly
|
|
47
47
|
* @minLength 1
|
|
48
48
|
* @maxLength 100
|
|
49
49
|
*/
|
|
50
50
|
paymentGatewayOrderId?: string | null;
|
|
51
51
|
/**
|
|
52
|
-
* Title
|
|
52
|
+
* Title displayed to the customer on the payment page.
|
|
53
53
|
* @minLength 1
|
|
54
54
|
* @maxLength 200
|
|
55
55
|
*/
|
|
56
56
|
title?: string;
|
|
57
57
|
/**
|
|
58
|
-
* Description
|
|
58
|
+
* Description displayed to the customer on the payment page.
|
|
59
59
|
* @maxLength 300
|
|
60
60
|
*/
|
|
61
61
|
description?: string | null;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Date and time the order payment request expires. If not provided, the order payment request doesn't expire.
|
|
64
64
|
* @immutable
|
|
65
65
|
*/
|
|
66
66
|
expirationDate?: Date | null;
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Custom field data for this order payment request.
|
|
69
|
+
*
|
|
70
|
+
* [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
|
|
71
|
+
*/
|
|
68
72
|
extendedFields?: ExtendedFields;
|
|
69
73
|
/**
|
|
70
|
-
* Date and time the
|
|
74
|
+
* Date and time the order payment request was created.
|
|
71
75
|
* @readonly
|
|
72
76
|
*/
|
|
73
77
|
_createdDate?: Date | null;
|
|
74
78
|
/**
|
|
75
|
-
* Date and time the
|
|
79
|
+
* Date and time the order payment request was last updated.
|
|
76
80
|
* @readonly
|
|
77
81
|
*/
|
|
78
82
|
_updatedDate?: Date | null;
|
|
@@ -86,7 +90,7 @@ interface OrderPaymentRequest {
|
|
|
86
90
|
}
|
|
87
91
|
interface Source {
|
|
88
92
|
/**
|
|
89
|
-
*
|
|
93
|
+
* ID of the app that created the order payment request.
|
|
90
94
|
* @format GUID
|
|
91
95
|
* @minLength 1
|
|
92
96
|
* @maxLength 100
|
|
@@ -94,7 +98,7 @@ interface Source {
|
|
|
94
98
|
*/
|
|
95
99
|
appId?: string | null;
|
|
96
100
|
/**
|
|
97
|
-
* Reference to
|
|
101
|
+
* Reference to a record in the source system. For example, if the payment request was created from a paylink or invoice, use this field to store the paylink ID or invoice ID.
|
|
98
102
|
* @minLength 1
|
|
99
103
|
* @maxLength 100
|
|
100
104
|
* @immutable
|
|
@@ -102,8 +106,11 @@ interface Source {
|
|
|
102
106
|
externalId?: string;
|
|
103
107
|
}
|
|
104
108
|
declare enum Status {
|
|
109
|
+
/** Payment is owed but hasn't been collected yet. */
|
|
105
110
|
UNPAID = "UNPAID",
|
|
111
|
+
/** Payment has been collected. */
|
|
106
112
|
PAID = "PAID",
|
|
113
|
+
/** The order payment request has passed its `expirationDate` without being paid. */
|
|
107
114
|
EXPIRED = "EXPIRED"
|
|
108
115
|
}
|
|
109
116
|
/** @enumType */
|
|
@@ -139,11 +146,13 @@ declare enum PaymentMethod {
|
|
|
139
146
|
type PaymentMethodWithLiterals = PaymentMethod | 'MANUAL';
|
|
140
147
|
interface ActionLinks {
|
|
141
148
|
/**
|
|
142
|
-
*
|
|
149
|
+
* Navigation action links rendered as anchors on the payment page.
|
|
150
|
+
*
|
|
151
|
+
* Currently supports a single action link.
|
|
143
152
|
* @maxSize 1
|
|
144
153
|
*/
|
|
145
154
|
general?: ActionLink[];
|
|
146
|
-
/**
|
|
155
|
+
/** Action link rendered as a button in error messages on the payment page. */
|
|
147
156
|
error?: ActionLink;
|
|
148
157
|
}
|
|
149
158
|
interface ActionLink {
|
|
@@ -167,7 +176,7 @@ interface SubscriptionInfo {
|
|
|
167
176
|
*/
|
|
168
177
|
title?: string;
|
|
169
178
|
/**
|
|
170
|
-
* Description of the charges
|
|
179
|
+
* Description of the charges applied for the subscription.
|
|
171
180
|
* @maxLength 1000
|
|
172
181
|
*/
|
|
173
182
|
chargeDescription?: string | null;
|
|
@@ -179,57 +188,124 @@ interface SubscriptionInfo {
|
|
|
179
188
|
/** Whether the subscription renews automatically. */
|
|
180
189
|
autoRenewal?: boolean;
|
|
181
190
|
}
|
|
182
|
-
/** Triggered when
|
|
191
|
+
/** Triggered when an order payment request's `status` changes to `PAID`. */
|
|
183
192
|
interface OrderPaymentRequestPaid {
|
|
184
|
-
/** Order payment request */
|
|
193
|
+
/** Order payment request that was paid. */
|
|
185
194
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
186
195
|
}
|
|
187
|
-
/** Triggered when
|
|
196
|
+
/** Triggered when an order payment request's `status` changes to `EXPIRED`. */
|
|
188
197
|
interface OrderPaymentRequestExpired {
|
|
189
|
-
/** Order payment request */
|
|
198
|
+
/** Order payment request that expired. */
|
|
190
199
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
191
200
|
}
|
|
192
|
-
/** Triggered when
|
|
201
|
+
/** Triggered when an order payment request's `status` changes to `VOIDED`. */
|
|
193
202
|
interface OrderPaymentRequestVoided {
|
|
194
|
-
/** Order payment request */
|
|
203
|
+
/** Order payment request that was voided. */
|
|
195
204
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
196
205
|
}
|
|
197
206
|
interface CreateOrderPaymentRequestRequest {
|
|
198
|
-
/**
|
|
207
|
+
/** Order payment request to create. */
|
|
199
208
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
200
209
|
}
|
|
201
210
|
interface CreateOrderPaymentRequestResponse {
|
|
202
|
-
/**
|
|
211
|
+
/** Created order payment request. */
|
|
203
212
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
204
213
|
/**
|
|
205
|
-
*
|
|
214
|
+
* Payment page URL for the order payment request. Share this URL with the customer so they can complete the payment.
|
|
206
215
|
* @minLength 1
|
|
207
216
|
* @maxLength 100
|
|
208
217
|
*/
|
|
209
218
|
orderPaymentRequestUrl?: string;
|
|
210
219
|
}
|
|
220
|
+
interface BulkCreateOrderPaymentRequestsRequest {
|
|
221
|
+
/**
|
|
222
|
+
* Order payment requests to create.
|
|
223
|
+
* @minSize 1
|
|
224
|
+
* @maxSize 100
|
|
225
|
+
*/
|
|
226
|
+
orderPaymentRequests: OrderPaymentRequest[];
|
|
227
|
+
/**
|
|
228
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
229
|
+
* Default: `false`.
|
|
230
|
+
*/
|
|
231
|
+
returnEntity?: boolean;
|
|
232
|
+
}
|
|
233
|
+
interface BulkCreateOrderPaymentRequestsResponse {
|
|
234
|
+
/**
|
|
235
|
+
* Results of the bulk create operation in the same order as the request items.
|
|
236
|
+
* @minSize 1
|
|
237
|
+
* @maxSize 100
|
|
238
|
+
*/
|
|
239
|
+
results?: BulkOrderPaymentRequestResult[];
|
|
240
|
+
/** Metadata about the bulk create operation. */
|
|
241
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
242
|
+
}
|
|
243
|
+
interface ItemMetadata {
|
|
244
|
+
/**
|
|
245
|
+
* Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.
|
|
246
|
+
* @format GUID
|
|
247
|
+
*/
|
|
248
|
+
_id?: string | null;
|
|
249
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
250
|
+
originalIndex?: number;
|
|
251
|
+
/** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
|
|
252
|
+
success?: boolean;
|
|
253
|
+
/** Details about the error in case of failure. */
|
|
254
|
+
error?: ApplicationError;
|
|
255
|
+
}
|
|
256
|
+
interface ApplicationError {
|
|
257
|
+
/** Error code. */
|
|
258
|
+
code?: string;
|
|
259
|
+
/** Description of the error. */
|
|
260
|
+
description?: string;
|
|
261
|
+
/** Data related to the error. */
|
|
262
|
+
data?: Record<string, any> | null;
|
|
263
|
+
}
|
|
264
|
+
interface BulkOrderPaymentRequestItem {
|
|
265
|
+
/** Created order payment request. */
|
|
266
|
+
orderPaymentRequest?: OrderPaymentRequest;
|
|
267
|
+
/**
|
|
268
|
+
* Payment page URL for the created order payment request.
|
|
269
|
+
* @format WEB_URL
|
|
270
|
+
*/
|
|
271
|
+
orderPaymentRequestUrl?: string;
|
|
272
|
+
}
|
|
273
|
+
interface BulkOrderPaymentRequestResult {
|
|
274
|
+
/** Metadata about this item, including its original request index and any error. */
|
|
275
|
+
itemMetadata?: ItemMetadata;
|
|
276
|
+
/** Created order payment request and its payment page URL. Returned when `returnEntity` is `true`. */
|
|
277
|
+
item?: BulkOrderPaymentRequestItem;
|
|
278
|
+
}
|
|
279
|
+
interface BulkActionMetadata {
|
|
280
|
+
/** Number of items that were successfully processed. */
|
|
281
|
+
totalSuccesses?: number;
|
|
282
|
+
/** Number of items that couldn't be processed. */
|
|
283
|
+
totalFailures?: number;
|
|
284
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
285
|
+
undetailedFailures?: number;
|
|
286
|
+
}
|
|
211
287
|
interface GetOrderPaymentRequestRequest {
|
|
212
288
|
/**
|
|
213
|
-
* ID of the
|
|
289
|
+
* ID of the order payment request to retrieve.
|
|
214
290
|
* @format GUID
|
|
215
291
|
*/
|
|
216
292
|
orderPaymentRequestId: string;
|
|
217
293
|
}
|
|
218
294
|
interface GetOrderPaymentRequestResponse {
|
|
219
|
-
/**
|
|
295
|
+
/** Retrieved order payment request. */
|
|
220
296
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
221
297
|
}
|
|
222
298
|
interface UpdateOrderPaymentRequestRequest {
|
|
223
|
-
/**
|
|
299
|
+
/** Order payment request to update. */
|
|
224
300
|
orderPaymentRequest: OrderPaymentRequest;
|
|
225
301
|
}
|
|
226
302
|
interface UpdateOrderPaymentRequestResponse {
|
|
227
|
-
/** Updated
|
|
303
|
+
/** Updated order payment request. */
|
|
228
304
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
229
305
|
}
|
|
230
306
|
interface DeleteOrderPaymentRequestRequest {
|
|
231
307
|
/**
|
|
232
|
-
*
|
|
308
|
+
* ID of the order payment request to delete.
|
|
233
309
|
* @format GUID
|
|
234
310
|
*/
|
|
235
311
|
orderPaymentRequestId: string;
|
|
@@ -296,11 +372,11 @@ interface CursorPaging {
|
|
|
296
372
|
}
|
|
297
373
|
interface QueryOrderPaymentRequestsResponse {
|
|
298
374
|
/**
|
|
299
|
-
* List of payment requests.
|
|
375
|
+
* List of order payment requests.
|
|
300
376
|
* @maxSize 1000
|
|
301
377
|
*/
|
|
302
378
|
orderPaymentRequests?: OrderPaymentRequest[];
|
|
303
|
-
/** Paging metadata */
|
|
379
|
+
/** Paging metadata. */
|
|
304
380
|
pagingMetadata?: CursorPagingMetadata;
|
|
305
381
|
}
|
|
306
382
|
interface CursorPagingMetadata {
|
|
@@ -330,14 +406,14 @@ interface Cursors {
|
|
|
330
406
|
}
|
|
331
407
|
interface GetOrderPaymentRequestURLRequest {
|
|
332
408
|
/**
|
|
333
|
-
*
|
|
409
|
+
* ID of the order payment request.
|
|
334
410
|
* @format GUID
|
|
335
411
|
*/
|
|
336
412
|
orderPaymentRequestId: string;
|
|
337
413
|
}
|
|
338
414
|
interface GetOrderPaymentRequestURLResponse {
|
|
339
415
|
/**
|
|
340
|
-
*
|
|
416
|
+
* Payment page URL for the order payment request.
|
|
341
417
|
* @minLength 1
|
|
342
418
|
* @maxLength 100
|
|
343
419
|
*/
|
|
@@ -352,7 +428,7 @@ interface UpdateExtendedFieldsRequest {
|
|
|
352
428
|
namespaceData: Record<string, any> | null;
|
|
353
429
|
}
|
|
354
430
|
interface UpdateExtendedFieldsResponse {
|
|
355
|
-
/** Updated
|
|
431
|
+
/** Updated order payment request. */
|
|
356
432
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
357
433
|
}
|
|
358
434
|
interface VoidOrderPaymentRequestRequest {
|
|
@@ -532,6 +608,10 @@ type CreateOrderPaymentRequestApplicationErrors = {
|
|
|
532
608
|
code?: 'INVALID_ORDER_STATUS_FOR_SUBSCRIPTION';
|
|
533
609
|
description?: string;
|
|
534
610
|
data?: Record<string, any>;
|
|
611
|
+
} | {
|
|
612
|
+
code?: 'ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND';
|
|
613
|
+
description?: string;
|
|
614
|
+
data?: Record<string, any>;
|
|
535
615
|
};
|
|
536
616
|
/** @docsIgnore */
|
|
537
617
|
type GetOrderPaymentRequestApplicationErrors = {
|
|
@@ -689,7 +769,7 @@ interface OrderPaymentRequestExpiredEnvelope {
|
|
|
689
769
|
metadata: EventMetadata;
|
|
690
770
|
}
|
|
691
771
|
/**
|
|
692
|
-
* Triggered when an order payment request status
|
|
772
|
+
* Triggered when an order payment request's `status` changes to `EXPIRED`.
|
|
693
773
|
* @permissionScope Manage Stores - all permissions
|
|
694
774
|
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
695
775
|
* @permissionScope Manage Stores
|
|
@@ -710,7 +790,7 @@ interface OrderPaymentRequestPaidEnvelope {
|
|
|
710
790
|
metadata: EventMetadata;
|
|
711
791
|
}
|
|
712
792
|
/**
|
|
713
|
-
* Triggered when an order payment request status
|
|
793
|
+
* Triggered when an order payment request's `status` changes to `PAID`.
|
|
714
794
|
* @permissionScope Manage Stores - all permissions
|
|
715
795
|
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
716
796
|
* @permissionScope Manage Stores
|
|
@@ -752,7 +832,7 @@ interface OrderPaymentRequestVoidedEnvelope {
|
|
|
752
832
|
metadata: EventMetadata;
|
|
753
833
|
}
|
|
754
834
|
/**
|
|
755
|
-
* Triggered when an order payment request status
|
|
835
|
+
* Triggered when an order payment request's `status` changes to `VOIDED`.
|
|
756
836
|
* @permissionScope Manage Stores - all permissions
|
|
757
837
|
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
758
838
|
* @permissionScope Manage Stores
|
|
@@ -769,7 +849,11 @@ interface OrderPaymentRequestVoidedEnvelope {
|
|
|
769
849
|
*/
|
|
770
850
|
declare function onOrderPaymentRequestVoided(handler: (event: OrderPaymentRequestVoidedEnvelope) => void | Promise<void>): void;
|
|
771
851
|
/**
|
|
772
|
-
* Creates
|
|
852
|
+
* Creates an order payment request.
|
|
853
|
+
*
|
|
854
|
+
* The response includes the payment page URL, which you can share with the customer. To retrieve the URL later, call [Get Order Payment Request URL](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/get-order-payment-request-url).
|
|
855
|
+
*
|
|
856
|
+
* Creation fails with `ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND` if the site doesn't have a Payment Request Page added and published.
|
|
773
857
|
* @public
|
|
774
858
|
* @documentationMaturity preview
|
|
775
859
|
* @requiredField options.orderPaymentRequest.amount
|
|
@@ -777,25 +861,32 @@ declare function onOrderPaymentRequestVoided(handler: (event: OrderPaymentReques
|
|
|
777
861
|
* @requiredField options.orderPaymentRequest.title
|
|
778
862
|
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_CREATE
|
|
779
863
|
* @applicableIdentity APP
|
|
780
|
-
* @returns
|
|
864
|
+
* @returns Created order payment request.
|
|
781
865
|
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.CreateOrderPaymentRequest
|
|
782
866
|
*/
|
|
783
867
|
declare function createOrderPaymentRequest(options?: NonNullablePaths<CreateOrderPaymentRequestOptions, `orderPaymentRequest.amount` | `orderPaymentRequest.orderId` | `orderPaymentRequest.title`, 3>): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
|
|
784
868
|
__applicationErrorsType?: CreateOrderPaymentRequestApplicationErrors;
|
|
785
869
|
}>;
|
|
786
870
|
interface CreateOrderPaymentRequestOptions {
|
|
787
|
-
/**
|
|
871
|
+
/** Order payment request to create. */
|
|
788
872
|
orderPaymentRequest?: OrderPaymentRequest;
|
|
789
873
|
}
|
|
874
|
+
interface BulkCreateOrderPaymentRequestsOptions {
|
|
875
|
+
/**
|
|
876
|
+
* Whether to return the created order payment requests and their payment page URLs in the response.
|
|
877
|
+
* Default: `false`.
|
|
878
|
+
*/
|
|
879
|
+
returnEntity?: boolean;
|
|
880
|
+
}
|
|
790
881
|
/**
|
|
791
|
-
* Retrieves
|
|
792
|
-
* @param orderPaymentRequestId - ID of the
|
|
882
|
+
* Retrieves an order payment request.
|
|
883
|
+
* @param orderPaymentRequestId - ID of the order payment request to retrieve.
|
|
793
884
|
* @public
|
|
794
885
|
* @documentationMaturity preview
|
|
795
886
|
* @requiredField orderPaymentRequestId
|
|
796
887
|
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
|
|
797
888
|
* @applicableIdentity APP
|
|
798
|
-
* @returns
|
|
889
|
+
* @returns Retrieved order payment request.
|
|
799
890
|
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.GetOrderPaymentRequest
|
|
800
891
|
*/
|
|
801
892
|
declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
|
|
@@ -812,7 +903,7 @@ declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<
|
|
|
812
903
|
* @requiredField orderPaymentRequest
|
|
813
904
|
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
|
|
814
905
|
* @applicableIdentity APP
|
|
815
|
-
* @returns Updated
|
|
906
|
+
* @returns Updated order payment request.
|
|
816
907
|
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.UpdateOrderPaymentRequest
|
|
817
908
|
*/
|
|
818
909
|
declare function updateOrderPaymentRequest(_id: string, orderPaymentRequest: UpdateOrderPaymentRequest): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
|
|
@@ -826,7 +917,7 @@ interface UpdateOrderPaymentRequest {
|
|
|
826
917
|
*/
|
|
827
918
|
_id?: string | null;
|
|
828
919
|
/**
|
|
829
|
-
*
|
|
920
|
+
* Details about the source that created the order payment request.
|
|
830
921
|
* @immutable
|
|
831
922
|
*/
|
|
832
923
|
source?: Source;
|
|
@@ -853,43 +944,47 @@ interface UpdateOrderPaymentRequest {
|
|
|
853
944
|
*/
|
|
854
945
|
amount?: Price;
|
|
855
946
|
/**
|
|
856
|
-
*
|
|
947
|
+
* Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.
|
|
857
948
|
* @format CURRENCY
|
|
858
949
|
* @readonly
|
|
859
950
|
*/
|
|
860
951
|
currency?: string;
|
|
861
952
|
/**
|
|
862
|
-
* Payment gateway order
|
|
953
|
+
* Payment gateway order ID associated with this payment request.
|
|
863
954
|
* @readonly
|
|
864
955
|
* @minLength 1
|
|
865
956
|
* @maxLength 100
|
|
866
957
|
*/
|
|
867
958
|
paymentGatewayOrderId?: string | null;
|
|
868
959
|
/**
|
|
869
|
-
* Title
|
|
960
|
+
* Title displayed to the customer on the payment page.
|
|
870
961
|
* @minLength 1
|
|
871
962
|
* @maxLength 200
|
|
872
963
|
*/
|
|
873
964
|
title?: string;
|
|
874
965
|
/**
|
|
875
|
-
* Description
|
|
966
|
+
* Description displayed to the customer on the payment page.
|
|
876
967
|
* @maxLength 300
|
|
877
968
|
*/
|
|
878
969
|
description?: string | null;
|
|
879
970
|
/**
|
|
880
|
-
*
|
|
971
|
+
* Date and time the order payment request expires. If not provided, the order payment request doesn't expire.
|
|
881
972
|
* @immutable
|
|
882
973
|
*/
|
|
883
974
|
expirationDate?: Date | null;
|
|
884
|
-
/**
|
|
975
|
+
/**
|
|
976
|
+
* Custom field data for this order payment request.
|
|
977
|
+
*
|
|
978
|
+
* [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
|
|
979
|
+
*/
|
|
885
980
|
extendedFields?: ExtendedFields;
|
|
886
981
|
/**
|
|
887
|
-
* Date and time the
|
|
982
|
+
* Date and time the order payment request was created.
|
|
888
983
|
* @readonly
|
|
889
984
|
*/
|
|
890
985
|
_createdDate?: Date | null;
|
|
891
986
|
/**
|
|
892
|
-
* Date and time the
|
|
987
|
+
* Date and time the order payment request was last updated.
|
|
893
988
|
* @readonly
|
|
894
989
|
*/
|
|
895
990
|
_updatedDate?: Date | null;
|
|
@@ -905,7 +1000,7 @@ interface UpdateOrderPaymentRequest {
|
|
|
905
1000
|
* Deletes an order payment request.
|
|
906
1001
|
*
|
|
907
1002
|
* You can delete an order payment request in any status except `PAID`. Attempting to delete a `PAID` order payment request fails with `CANNOT_DELETE_PAID_ORDER_PAYMENT_REQUEST`.
|
|
908
|
-
* @param orderPaymentRequestId -
|
|
1003
|
+
* @param orderPaymentRequestId - ID of the order payment request to delete.
|
|
909
1004
|
* @public
|
|
910
1005
|
* @documentationMaturity preview
|
|
911
1006
|
* @requiredField orderPaymentRequestId
|
|
@@ -917,11 +1012,11 @@ declare function deleteOrderPaymentRequest(orderPaymentRequestId: string): Promi
|
|
|
917
1012
|
__applicationErrorsType?: DeleteOrderPaymentRequestApplicationErrors;
|
|
918
1013
|
}>;
|
|
919
1014
|
/**
|
|
920
|
-
* Retrieves a list of
|
|
1015
|
+
* Retrieves a list of up to 1,000 order payment requests, given the provided [paging, filtering, and sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
|
|
921
1016
|
*
|
|
922
|
-
* Query Payment Requests runs with these defaults, which you can override:
|
|
923
|
-
* - `
|
|
924
|
-
* - `cursorPaging.limit` is 100
|
|
1017
|
+
* Query Order Payment Requests runs with these defaults, which you can override:
|
|
1018
|
+
* - `_createdDate` is sorted in `DESC` order
|
|
1019
|
+
* - `cursorPaging.limit` is `100`
|
|
925
1020
|
*
|
|
926
1021
|
* To learn about working with _Query_ endpoints, see
|
|
927
1022
|
* [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
|
|
@@ -1104,8 +1199,8 @@ declare const utils: {
|
|
|
1104
1199
|
};
|
|
1105
1200
|
};
|
|
1106
1201
|
/**
|
|
1107
|
-
* Retrieves the
|
|
1108
|
-
* @param orderPaymentRequestId -
|
|
1202
|
+
* Retrieves the payment page URL for an order payment request.
|
|
1203
|
+
* @param orderPaymentRequestId - ID of the order payment request.
|
|
1109
1204
|
* @public
|
|
1110
1205
|
* @documentationMaturity preview
|
|
1111
1206
|
* @requiredField orderPaymentRequestId
|
|
@@ -1117,7 +1212,7 @@ declare function getOrderPaymentRequestUrl(orderPaymentRequestId: string): Promi
|
|
|
1117
1212
|
__applicationErrorsType?: GetOrderPaymentRequestUrlApplicationErrors;
|
|
1118
1213
|
}>;
|
|
1119
1214
|
/**
|
|
1120
|
-
* Updates extended fields of
|
|
1215
|
+
* Updates the extended fields of an order payment request.
|
|
1121
1216
|
* @param _id - ID of the entity to update.
|
|
1122
1217
|
* @param namespace - Identifier for the app whose extended fields are being updated.
|
|
1123
1218
|
* @public
|
|
@@ -1135,5 +1230,20 @@ interface UpdateExtendedFieldsOptions {
|
|
|
1135
1230
|
/** 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. */
|
|
1136
1231
|
namespaceData: Record<string, any> | null;
|
|
1137
1232
|
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Voids the given order payment request.
|
|
1235
|
+
*
|
|
1236
|
+
* Only `UNPAID` order payment requests can be voided. Voiding an order payment request that is already `VOIDED` succeeds without making any changes. Voiding a `PAID` or `EXPIRED` order payment request fails.
|
|
1237
|
+
* @param orderPaymentRequestId - ID of the order payment request to void.
|
|
1238
|
+
* @public
|
|
1239
|
+
* @documentationMaturity preview
|
|
1240
|
+
* @requiredField orderPaymentRequestId
|
|
1241
|
+
* @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
|
|
1242
|
+
* @applicableIdentity APP
|
|
1243
|
+
* @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.VoidOrderPaymentRequest
|
|
1244
|
+
*/
|
|
1245
|
+
declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise<void & {
|
|
1246
|
+
__applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
|
|
1247
|
+
}>;
|
|
1138
1248
|
|
|
1139
|
-
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type BaseEventMetadata, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils };
|
|
1249
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateOrderPaymentRequestsOptions, type BulkCreateOrderPaymentRequestsRequest, type BulkCreateOrderPaymentRequestsResponse, type BulkOrderPaymentRequestItem, type BulkOrderPaymentRequestResult, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils, voidOrderPaymentRequest };
|
|
@@ -24,6 +24,7 @@ __export(index_typings_exports, {
|
|
|
24
24
|
SortOrder: () => SortOrder,
|
|
25
25
|
Status: () => Status,
|
|
26
26
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
27
|
+
bulkCreateOrderPaymentRequests: () => bulkCreateOrderPaymentRequests2,
|
|
27
28
|
createOrderPaymentRequest: () => createOrderPaymentRequest2,
|
|
28
29
|
deleteOrderPaymentRequest: () => deleteOrderPaymentRequest2,
|
|
29
30
|
getOrderPaymentRequest: () => getOrderPaymentRequest2,
|
|
@@ -130,6 +131,49 @@ function createOrderPaymentRequest(payload) {
|
|
|
130
131
|
}
|
|
131
132
|
return __createOrderPaymentRequest;
|
|
132
133
|
}
|
|
134
|
+
function bulkCreateOrderPaymentRequests(payload) {
|
|
135
|
+
function __bulkCreateOrderPaymentRequests({ host }) {
|
|
136
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
137
|
+
{
|
|
138
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
139
|
+
paths: [
|
|
140
|
+
{ path: "orderPaymentRequests.expirationDate" },
|
|
141
|
+
{ path: "orderPaymentRequests.createdDate" },
|
|
142
|
+
{ path: "orderPaymentRequests.updatedDate" }
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
]);
|
|
146
|
+
const metadata = {
|
|
147
|
+
entityFqdn: "wix.ecom.v1.order_payment_request",
|
|
148
|
+
method: "POST",
|
|
149
|
+
methodFqn: "wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.BulkCreateOrderPaymentRequests",
|
|
150
|
+
packageName: PACKAGE_NAME,
|
|
151
|
+
migrationOptions: {
|
|
152
|
+
optInTransformResponse: true
|
|
153
|
+
},
|
|
154
|
+
url: resolveWixEcomOrderPaymentRequestApiV1OrderPaymentRequestsServiceUrl(
|
|
155
|
+
{
|
|
156
|
+
protoPath: "/v1/bulk/order-payment-requests/create",
|
|
157
|
+
data: serializedData,
|
|
158
|
+
host
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
data: serializedData,
|
|
162
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
163
|
+
{
|
|
164
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
165
|
+
paths: [
|
|
166
|
+
{ path: "results.item.orderPaymentRequest.expirationDate" },
|
|
167
|
+
{ path: "results.item.orderPaymentRequest.createdDate" },
|
|
168
|
+
{ path: "results.item.orderPaymentRequest.updatedDate" }
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
])
|
|
172
|
+
};
|
|
173
|
+
return metadata;
|
|
174
|
+
}
|
|
175
|
+
return __bulkCreateOrderPaymentRequests;
|
|
176
|
+
}
|
|
133
177
|
function getOrderPaymentRequest(payload) {
|
|
134
178
|
function __getOrderPaymentRequest({ host }) {
|
|
135
179
|
const metadata = {
|
|
@@ -405,6 +449,52 @@ async function createOrderPaymentRequest2(options) {
|
|
|
405
449
|
throw transformedError;
|
|
406
450
|
}
|
|
407
451
|
}
|
|
452
|
+
async function bulkCreateOrderPaymentRequests2(orderPaymentRequests, options) {
|
|
453
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
454
|
+
const payload = (0, import_transform_paths2.transformPaths)(
|
|
455
|
+
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
456
|
+
orderPaymentRequests,
|
|
457
|
+
returnEntity: options?.returnEntity
|
|
458
|
+
}),
|
|
459
|
+
[
|
|
460
|
+
{
|
|
461
|
+
transformFn: import_image.transformSDKImageToRESTImage,
|
|
462
|
+
paths: [{ path: "orderPaymentRequests.image" }]
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
);
|
|
466
|
+
const reqOpts = bulkCreateOrderPaymentRequests(
|
|
467
|
+
payload
|
|
468
|
+
);
|
|
469
|
+
sideEffects?.onSiteCall?.();
|
|
470
|
+
try {
|
|
471
|
+
const result = await httpClient.request(reqOpts);
|
|
472
|
+
sideEffects?.onSuccess?.(result);
|
|
473
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
474
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
475
|
+
{
|
|
476
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
477
|
+
paths: [{ path: "results.item.orderPaymentRequest.image" }]
|
|
478
|
+
}
|
|
479
|
+
])
|
|
480
|
+
);
|
|
481
|
+
} catch (err) {
|
|
482
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
483
|
+
err,
|
|
484
|
+
{
|
|
485
|
+
spreadPathsToArguments: {},
|
|
486
|
+
explicitPathsToArguments: {
|
|
487
|
+
orderPaymentRequests: "$[0]",
|
|
488
|
+
returnEntity: "$[1].returnEntity"
|
|
489
|
+
},
|
|
490
|
+
singleArgumentUnchanged: false
|
|
491
|
+
},
|
|
492
|
+
["orderPaymentRequests", "options"]
|
|
493
|
+
);
|
|
494
|
+
sideEffects?.onError?.(err);
|
|
495
|
+
throw transformedError;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
408
498
|
async function getOrderPaymentRequest2(orderPaymentRequestId) {
|
|
409
499
|
const { httpClient, sideEffects } = arguments[1];
|
|
410
500
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -683,6 +773,7 @@ async function voidOrderPaymentRequest2(orderPaymentRequestId) {
|
|
|
683
773
|
SortOrder,
|
|
684
774
|
Status,
|
|
685
775
|
WebhookIdentityType,
|
|
776
|
+
bulkCreateOrderPaymentRequests,
|
|
686
777
|
createOrderPaymentRequest,
|
|
687
778
|
deleteOrderPaymentRequest,
|
|
688
779
|
getOrderPaymentRequest,
|