@wix/auto_sdk_payments_saved-payment-methods 1.0.41 → 1.0.43
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 +24 -14
- package/build/cjs/index.js +14 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +86 -79
- package/build/cjs/index.typings.js +14 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +38 -39
- package/build/cjs/meta.js +14 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.js +141 -117
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +24 -14
- package/build/es/index.mjs +14 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +86 -79
- package/build/es/index.typings.mjs +14 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +38 -39
- package/build/es/meta.mjs +14 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.mjs +141 -117
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +24 -14
- package/build/internal/cjs/index.js +14 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +86 -79
- package/build/internal/cjs/index.typings.js +14 -1
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +38 -39
- package/build/internal/cjs/meta.js +14 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.js +141 -117
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +24 -14
- package/build/internal/es/index.mjs +14 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +86 -79
- package/build/internal/es/index.typings.mjs +14 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +38 -39
- package/build/internal/es/meta.mjs +14 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.mjs +141 -117
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2,83 +2,88 @@ import { NonNullablePaths } from '@wix/sdk-types';
|
|
|
2
2
|
|
|
3
3
|
interface SavedPaymentMethod {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Saved payment method ID.
|
|
6
6
|
* @format GUID
|
|
7
7
|
* @readonly
|
|
8
8
|
*/
|
|
9
9
|
_id?: string | null;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Revision number, which increments by 1 each time the saved payment method is updated.
|
|
12
|
+
* To prevent conflicting changes, the current revision must be passed when updating the saved payment method.
|
|
12
13
|
* @readonly
|
|
13
14
|
*/
|
|
14
15
|
revision?: string | null;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Date and time the saved payment method was created.
|
|
17
18
|
* @readonly
|
|
18
19
|
*/
|
|
19
20
|
_createdDate?: Date | null;
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* Date and time the saved payment method was last updated.
|
|
22
23
|
* @readonly
|
|
23
24
|
*/
|
|
24
25
|
_updatedDate?: Date | null;
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* ID of the site member who owns this saved payment method.
|
|
27
28
|
* @format GUID
|
|
28
29
|
* @immutable
|
|
29
30
|
*/
|
|
30
31
|
siteMemberId?: string | null;
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* Whether this saved payment method is the primary one for the member. Each member can have at most one primary saved payment method. The primary method is selected by default during checkout.
|
|
33
34
|
* @readonly
|
|
34
35
|
*/
|
|
35
36
|
primary?: boolean;
|
|
36
37
|
/** Payment method details. */
|
|
37
38
|
paymentMethod?: PaymentMethod;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Even
|
|
40
|
+
* Whether the merchant can use this payment method for unscheduled payments, such as manual charges.
|
|
41
|
+
* Even when set to `false`, the payment method can still be used for scheduled payments such as subscription renewals without the buyer being present.
|
|
41
42
|
*/
|
|
42
43
|
merchantUseAllowed?: boolean | null;
|
|
43
44
|
/**
|
|
44
|
-
* Saved payment method sensitive information.
|
|
45
|
+
* Saved payment method's sensitive information.
|
|
45
46
|
* @readonly
|
|
46
47
|
*/
|
|
47
48
|
sensitiveInfo?: SensitiveInfo;
|
|
48
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Custom field data for the saved payment method object.
|
|
51
|
+
*
|
|
52
|
+
* [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.
|
|
53
|
+
*/
|
|
49
54
|
extendedFields?: ExtendedFields;
|
|
50
55
|
}
|
|
51
56
|
interface CardInfo {
|
|
52
57
|
/**
|
|
53
|
-
*
|
|
58
|
+
* Payment card's last 4 digits.
|
|
54
59
|
* @minLength 4
|
|
55
60
|
* @maxLength 4
|
|
56
61
|
* @readonly
|
|
57
62
|
*/
|
|
58
63
|
lastFourDigits?: string | null;
|
|
59
64
|
/**
|
|
60
|
-
*
|
|
65
|
+
* Payment card's BIN (Bank Identification Number). First 4-6 digits of the card number.
|
|
61
66
|
* @minLength 4
|
|
62
67
|
* @maxLength 6
|
|
63
68
|
* @readonly
|
|
64
69
|
*/
|
|
65
70
|
bin?: string | null;
|
|
66
71
|
/**
|
|
67
|
-
*
|
|
72
|
+
* Payment card's expiration month.
|
|
68
73
|
* @min 1
|
|
69
74
|
* @max 12
|
|
70
75
|
* @immutable
|
|
71
76
|
*/
|
|
72
77
|
expirationMonth?: number | null;
|
|
73
78
|
/**
|
|
74
|
-
*
|
|
79
|
+
* Payment card's expiration year.
|
|
75
80
|
* @min 2000
|
|
76
81
|
* @max 2099
|
|
77
82
|
* @immutable
|
|
78
83
|
*/
|
|
79
84
|
expirationYear?: number | null;
|
|
80
85
|
/**
|
|
81
|
-
*
|
|
86
|
+
* Cardholder's full name as it appears on the card.
|
|
82
87
|
* @minLength 1
|
|
83
88
|
* @maxLength 1000
|
|
84
89
|
*/
|
|
@@ -102,7 +107,7 @@ declare enum CardBrand {
|
|
|
102
107
|
type CardBrandWithLiterals = CardBrand | 'UNKNOWN_CARD_BRAND' | 'AMEX' | 'DANKORT' | 'DINERS' | 'DISCOVER' | 'ISRACARD' | 'JCB' | 'MAESTRO' | 'MASTERCARD' | 'UNIONPAY' | 'VISA' | 'RUPAY';
|
|
103
108
|
interface PaymentMethod {
|
|
104
109
|
/**
|
|
105
|
-
* Legacy payment method type ID. Supported values
|
|
110
|
+
* Legacy payment method type ID. Supported values: `creditCard`, `payPal`.
|
|
106
111
|
* @minLength 1
|
|
107
112
|
* @maxLength 100
|
|
108
113
|
* @immutable
|
|
@@ -122,16 +127,16 @@ interface PaymentMethod {
|
|
|
122
127
|
* @immutable
|
|
123
128
|
*/
|
|
124
129
|
paymentMethodBrandId?: string | null;
|
|
125
|
-
/**
|
|
130
|
+
/** Payment card details. */
|
|
126
131
|
cardInfo?: CardInfo;
|
|
127
132
|
}
|
|
128
133
|
interface SensitiveInfo {
|
|
129
|
-
/**
|
|
134
|
+
/** Payment card sensitive details. */
|
|
130
135
|
cardSensitiveInfo?: CardSensitiveInfo;
|
|
131
136
|
}
|
|
132
137
|
interface CardSensitiveInfo {
|
|
133
138
|
/**
|
|
134
|
-
* Persistent token of
|
|
139
|
+
* Persistent token of a payment card tokenized by Wix.
|
|
135
140
|
* @format GUID
|
|
136
141
|
*/
|
|
137
142
|
persistentToken?: string | null;
|
|
@@ -148,16 +153,16 @@ interface ExtendedFields {
|
|
|
148
153
|
namespaces?: Record<string, Record<string, any>>;
|
|
149
154
|
}
|
|
150
155
|
interface UpsertSavedPaymentMethodRequest {
|
|
151
|
-
/** Saved payment method. */
|
|
156
|
+
/** Saved payment method to create or update. */
|
|
152
157
|
savedPaymentMethod: SavedPaymentMethod;
|
|
153
158
|
/**
|
|
154
|
-
* Temporary token of
|
|
159
|
+
* Temporary token of a payment card tokenized by Wix. Used to create a persistent token for future transactions.
|
|
155
160
|
* @format GUID
|
|
156
161
|
*/
|
|
157
162
|
temporaryCardToken: string | null;
|
|
158
163
|
}
|
|
159
164
|
interface UpsertSavedPaymentMethodResponse {
|
|
160
|
-
/**
|
|
165
|
+
/** Created or updated saved payment method. */
|
|
161
166
|
savedPaymentMethod?: SavedPaymentMethod;
|
|
162
167
|
}
|
|
163
168
|
interface GetSavedPaymentMethodRequest {
|
|
@@ -167,19 +172,19 @@ interface GetSavedPaymentMethodRequest {
|
|
|
167
172
|
*/
|
|
168
173
|
savedPaymentMethodId: string;
|
|
169
174
|
/**
|
|
170
|
-
*
|
|
171
|
-
* You should have additional permission in order to get them as described in HidedFields documentation.
|
|
175
|
+
* Additional fields to return.
|
|
172
176
|
* @maxSize 1
|
|
173
177
|
*/
|
|
174
178
|
fields?: RequestedFieldsWithLiterals[];
|
|
175
179
|
}
|
|
176
180
|
declare enum RequestedFields {
|
|
181
|
+
/** Sensitive information such as payment card tokens. */
|
|
177
182
|
SENSITIVE_INFO = "SENSITIVE_INFO"
|
|
178
183
|
}
|
|
179
184
|
/** @enumType */
|
|
180
185
|
type RequestedFieldsWithLiterals = RequestedFields | 'SENSITIVE_INFO';
|
|
181
186
|
interface GetSavedPaymentMethodResponse {
|
|
182
|
-
/**
|
|
187
|
+
/** Retrieved saved payment method. */
|
|
183
188
|
savedPaymentMethod?: SavedPaymentMethod;
|
|
184
189
|
}
|
|
185
190
|
interface DeleteSavedPaymentMethodRequest {
|
|
@@ -193,34 +198,28 @@ interface DeleteSavedPaymentMethodResponse {
|
|
|
193
198
|
}
|
|
194
199
|
interface ListSavedPaymentMethodsRequest {
|
|
195
200
|
/**
|
|
196
|
-
*
|
|
197
|
-
* Pass `me` to list saved payment method of the current site member.
|
|
201
|
+
* ID of the site member whose saved payment methods to list. Pass `me` to list the current site member's saved payment methods.
|
|
198
202
|
* @minLength 2
|
|
199
203
|
* @maxLength 36
|
|
200
204
|
*/
|
|
201
205
|
siteMemberId?: string | null;
|
|
202
206
|
/**
|
|
203
|
-
*
|
|
207
|
+
* Legacy payment method type ID. Supported values: `creditCard`, `payPal`.
|
|
204
208
|
* @minLength 1
|
|
205
209
|
* @maxLength 100
|
|
206
210
|
*/
|
|
207
211
|
paymentMethodTypeId?: string | null;
|
|
208
|
-
/**
|
|
209
|
-
* Defines whether this payment method can be used by the merchant for making unscheduled payments.
|
|
210
|
-
* Even if it's set to `false` payment method still can be used for scheduled payments e.g. subscription renewal without the buyer being present.
|
|
211
|
-
*/
|
|
212
|
+
/** Whether to filter by saved payment methods that are allowed for unscheduled merchant-initiated payments. */
|
|
212
213
|
merchantUseAllowed?: boolean | null;
|
|
213
214
|
/**
|
|
214
|
-
*
|
|
215
|
-
* Supported values:
|
|
216
|
-
* SENSITIVE_INFO - Sensitive information of a SavedPaymentMethod like credit card tokens that's needed to process payments with it.
|
|
217
|
-
* In order to receive it you should have `PAYMENTS.SAVED_PAYMENT_METHOD_READ_SENSITIVE_INFO` permission
|
|
215
|
+
* Additional fields to return.
|
|
218
216
|
* @maxSize 1
|
|
219
217
|
*/
|
|
220
218
|
fields?: RequestedFieldsWithLiterals[];
|
|
221
219
|
/**
|
|
222
|
-
*
|
|
223
|
-
*
|
|
220
|
+
* Cursor paging parameters.
|
|
221
|
+
*
|
|
222
|
+
* Default: `100` results per page.
|
|
224
223
|
*/
|
|
225
224
|
paging?: CursorPaging;
|
|
226
225
|
}
|
|
@@ -242,7 +241,7 @@ interface CursorPaging {
|
|
|
242
241
|
interface ListSavedPaymentMethodsResponse {
|
|
243
242
|
/** List of saved payment methods. */
|
|
244
243
|
savedPaymentMethods?: SavedPaymentMethod[];
|
|
245
|
-
/**
|
|
244
|
+
/** Details on the paged set of results returned. */
|
|
246
245
|
pagingMetadata?: CursorPagingMetadata;
|
|
247
246
|
}
|
|
248
247
|
interface CursorPagingMetadata {
|
|
@@ -562,10 +561,15 @@ interface SavedPaymentMethodUpdatedEnvelope {
|
|
|
562
561
|
*/
|
|
563
562
|
declare function onSavedPaymentMethodUpdated(handler: (event: SavedPaymentMethodUpdatedEnvelope) => void | Promise<void>): void;
|
|
564
563
|
/**
|
|
565
|
-
* Creates
|
|
566
|
-
*
|
|
567
|
-
* If
|
|
568
|
-
*
|
|
564
|
+
* Creates or updates a saved payment method.
|
|
565
|
+
*
|
|
566
|
+
* If a saved payment method with matching card details (expiration date, last four digits, and BIN) already exists for the same site member,
|
|
567
|
+
* the existing saved payment method is updated. Otherwise, a new saved payment method is created.
|
|
568
|
+
*
|
|
569
|
+
* Payment cards are currently supported. Support for other payment method types may vary and is subject to change.
|
|
570
|
+
*
|
|
571
|
+
* > **Note:** The system may limit the number of saved payment methods per site member.
|
|
572
|
+
* @param savedPaymentMethod - Saved payment method to create or update.
|
|
569
573
|
* @public
|
|
570
574
|
* @documentationMaturity preview
|
|
571
575
|
* @requiredField options
|
|
@@ -582,33 +586,34 @@ declare function onSavedPaymentMethodUpdated(handler: (event: SavedPaymentMethod
|
|
|
582
586
|
declare function upsertSavedPaymentMethod(savedPaymentMethod: NonNullablePaths<SavedPaymentMethod, `paymentMethod` | `paymentMethod.cardInfo.expirationMonth` | `paymentMethod.cardInfo.expirationYear` | `paymentMethod.typeId`, 4>, options: NonNullablePaths<UpsertSavedPaymentMethodOptions, `temporaryCardToken`, 2>): Promise<NonNullablePaths<UpsertSavedPaymentMethodResponse, `savedPaymentMethod.primary` | `savedPaymentMethod.paymentMethod.typeId` | `savedPaymentMethod.paymentMethod.paymentMethodTypeId`, 4>>;
|
|
583
587
|
interface UpsertSavedPaymentMethodOptions {
|
|
584
588
|
/**
|
|
585
|
-
* Temporary token of
|
|
589
|
+
* Temporary token of a payment card tokenized by Wix. Used to create a persistent token for future transactions.
|
|
586
590
|
* @format GUID
|
|
587
591
|
*/
|
|
588
592
|
temporaryCardToken: string | null;
|
|
589
593
|
}
|
|
590
594
|
/**
|
|
591
|
-
*
|
|
595
|
+
* Retrieves a saved payment method by ID.
|
|
592
596
|
* @param savedPaymentMethodId - Unique identifier of a saved payment method.
|
|
593
597
|
* @public
|
|
594
598
|
* @documentationMaturity preview
|
|
595
599
|
* @requiredField savedPaymentMethodId
|
|
596
600
|
* @permissionId PAYMENTS.SAVED_PAYMENT_METHOD_READ
|
|
597
601
|
* @permissionId PAYMENTS.SAVED_PAYMENT_METHOD_READ_SENSITIVE_INFO
|
|
598
|
-
* @returns
|
|
602
|
+
* @returns Retrieved saved payment method.
|
|
599
603
|
* @fqn wix.payments.saved_payment_methods.v1.SavedPaymentMethodService.GetSavedPaymentMethod
|
|
600
604
|
*/
|
|
601
605
|
declare function getSavedPaymentMethod(savedPaymentMethodId: string, options?: GetSavedPaymentMethodOptions): Promise<NonNullablePaths<SavedPaymentMethod, `primary` | `paymentMethod.typeId` | `paymentMethod.paymentMethodTypeId`, 3>>;
|
|
602
606
|
interface GetSavedPaymentMethodOptions {
|
|
603
607
|
/**
|
|
604
|
-
*
|
|
605
|
-
* You should have additional permission in order to get them as described in HidedFields documentation.
|
|
608
|
+
* Additional fields to return.
|
|
606
609
|
* @maxSize 1
|
|
607
610
|
*/
|
|
608
611
|
fields?: RequestedFieldsWithLiterals[];
|
|
609
612
|
}
|
|
610
613
|
/**
|
|
611
|
-
* Deletes
|
|
614
|
+
* Deletes a saved payment method.
|
|
615
|
+
*
|
|
616
|
+
* If the deleted saved payment method was the primary one, the system automatically assigns another saved payment method as primary.
|
|
612
617
|
* @param savedPaymentMethodId - Unique identifier of a saved payment method.
|
|
613
618
|
* @public
|
|
614
619
|
* @documentationMaturity preview
|
|
@@ -618,7 +623,7 @@ interface GetSavedPaymentMethodOptions {
|
|
|
618
623
|
*/
|
|
619
624
|
declare function deleteSavedPaymentMethod(savedPaymentMethodId: string): Promise<void>;
|
|
620
625
|
/**
|
|
621
|
-
*
|
|
626
|
+
* Retrieves a list of saved payment methods, sorted by last updated date in descending order.
|
|
622
627
|
* @public
|
|
623
628
|
* @documentationMaturity preview
|
|
624
629
|
* @permissionId PAYMENTS.SAVED_PAYMENT_METHOD_READ
|
|
@@ -628,40 +633,38 @@ declare function deleteSavedPaymentMethod(savedPaymentMethodId: string): Promise
|
|
|
628
633
|
declare function listSavedPaymentMethods(options?: ListSavedPaymentMethodsOptions): Promise<NonNullablePaths<ListSavedPaymentMethodsResponse, `savedPaymentMethods` | `savedPaymentMethods.${number}.primary` | `savedPaymentMethods.${number}.paymentMethod.typeId` | `savedPaymentMethods.${number}.paymentMethod.paymentMethodTypeId`, 5>>;
|
|
629
634
|
interface ListSavedPaymentMethodsOptions {
|
|
630
635
|
/**
|
|
631
|
-
*
|
|
632
|
-
* Pass `me` to list saved payment method of the current site member.
|
|
636
|
+
* ID of the site member whose saved payment methods to list. Pass `me` to list the current site member's saved payment methods.
|
|
633
637
|
* @minLength 2
|
|
634
638
|
* @maxLength 36
|
|
635
639
|
*/
|
|
636
640
|
siteMemberId?: string | null;
|
|
637
641
|
/**
|
|
638
|
-
*
|
|
642
|
+
* Legacy payment method type ID. Supported values: `creditCard`, `payPal`.
|
|
639
643
|
* @minLength 1
|
|
640
644
|
* @maxLength 100
|
|
641
645
|
*/
|
|
642
646
|
paymentMethodTypeId?: string | null;
|
|
643
|
-
/**
|
|
644
|
-
* Defines whether this payment method can be used by the merchant for making unscheduled payments.
|
|
645
|
-
* Even if it's set to `false` payment method still can be used for scheduled payments e.g. subscription renewal without the buyer being present.
|
|
646
|
-
*/
|
|
647
|
+
/** Whether to filter by saved payment methods that are allowed for unscheduled merchant-initiated payments. */
|
|
647
648
|
merchantUseAllowed?: boolean | null;
|
|
648
649
|
/**
|
|
649
|
-
*
|
|
650
|
-
* Supported values:
|
|
651
|
-
* SENSITIVE_INFO - Sensitive information of a SavedPaymentMethod like credit card tokens that's needed to process payments with it.
|
|
652
|
-
* In order to receive it you should have `PAYMENTS.SAVED_PAYMENT_METHOD_READ_SENSITIVE_INFO` permission
|
|
650
|
+
* Additional fields to return.
|
|
653
651
|
* @maxSize 1
|
|
654
652
|
*/
|
|
655
653
|
fields?: RequestedFieldsWithLiterals[];
|
|
656
654
|
/**
|
|
657
|
-
*
|
|
658
|
-
*
|
|
655
|
+
* Cursor paging parameters.
|
|
656
|
+
*
|
|
657
|
+
* Default: `100` results per page.
|
|
659
658
|
*/
|
|
660
659
|
paging?: CursorPaging;
|
|
661
660
|
}
|
|
662
661
|
/**
|
|
663
|
-
* Updates
|
|
664
|
-
*
|
|
662
|
+
* Updates a saved payment method.
|
|
663
|
+
*
|
|
664
|
+
* Each time the saved payment method is updated, `revision` increments by 1.
|
|
665
|
+
* The current `revision` must be passed when updating the saved payment method.
|
|
666
|
+
* This ensures you're working with the latest saved payment method and prevents unintended overwrites.
|
|
667
|
+
* @param _id - Saved payment method ID.
|
|
665
668
|
* @public
|
|
666
669
|
* @documentationMaturity preview
|
|
667
670
|
* @requiredField _id
|
|
@@ -674,58 +677,62 @@ declare function updateSavedPaymentMethod(_id: string, options?: NonNullablePath
|
|
|
674
677
|
interface UpdateSavedPaymentMethodOptions {
|
|
675
678
|
savedPaymentMethod?: {
|
|
676
679
|
/**
|
|
677
|
-
*
|
|
680
|
+
* Saved payment method ID.
|
|
678
681
|
* @format GUID
|
|
679
682
|
* @readonly
|
|
680
683
|
*/
|
|
681
684
|
_id?: string | null;
|
|
682
685
|
/**
|
|
683
|
-
*
|
|
686
|
+
* Revision number, which increments by 1 each time the saved payment method is updated.
|
|
687
|
+
* To prevent conflicting changes, the current revision must be passed when updating the saved payment method.
|
|
684
688
|
* @readonly
|
|
685
689
|
*/
|
|
686
690
|
revision?: string | null;
|
|
687
691
|
/**
|
|
688
|
-
*
|
|
692
|
+
* Date and time the saved payment method was created.
|
|
689
693
|
* @readonly
|
|
690
694
|
*/
|
|
691
695
|
_createdDate?: Date | null;
|
|
692
696
|
/**
|
|
693
|
-
*
|
|
697
|
+
* Date and time the saved payment method was last updated.
|
|
694
698
|
* @readonly
|
|
695
699
|
*/
|
|
696
700
|
_updatedDate?: Date | null;
|
|
697
701
|
/**
|
|
698
|
-
*
|
|
702
|
+
* ID of the site member who owns this saved payment method.
|
|
699
703
|
* @format GUID
|
|
700
704
|
* @immutable
|
|
701
705
|
*/
|
|
702
706
|
siteMemberId?: string | null;
|
|
703
707
|
/**
|
|
704
|
-
*
|
|
708
|
+
* Whether this saved payment method is the primary one for the member. Each member can have at most one primary saved payment method. The primary method is selected by default during checkout.
|
|
705
709
|
* @readonly
|
|
706
710
|
*/
|
|
707
711
|
primary?: boolean;
|
|
708
712
|
/** Payment method details. */
|
|
709
713
|
paymentMethod?: PaymentMethod;
|
|
710
714
|
/**
|
|
711
|
-
*
|
|
712
|
-
* Even
|
|
715
|
+
* Whether the merchant can use this payment method for unscheduled payments, such as manual charges.
|
|
716
|
+
* Even when set to `false`, the payment method can still be used for scheduled payments such as subscription renewals without the buyer being present.
|
|
713
717
|
*/
|
|
714
718
|
merchantUseAllowed?: boolean | null;
|
|
715
719
|
/**
|
|
716
|
-
* Saved payment method sensitive information.
|
|
720
|
+
* Saved payment method's sensitive information.
|
|
717
721
|
* @readonly
|
|
718
722
|
*/
|
|
719
723
|
sensitiveInfo?: SensitiveInfo;
|
|
720
|
-
/**
|
|
724
|
+
/**
|
|
725
|
+
* Custom field data for the saved payment method object.
|
|
726
|
+
*
|
|
727
|
+
* [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.
|
|
728
|
+
*/
|
|
721
729
|
extendedFields?: ExtendedFields;
|
|
722
730
|
};
|
|
723
731
|
}
|
|
724
732
|
/**
|
|
725
|
-
* Marks
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
* so when one SavedPaymentMethod is marked as primary previous one is automatically unmarked.
|
|
733
|
+
* Marks a saved payment method as primary for the site member who owns it.
|
|
734
|
+
* A primary saved payment method is selected by default during checkout.
|
|
735
|
+
* Each site member can have at most one primary saved payment method, so marking one as primary automatically unmarks the previous one.
|
|
729
736
|
* @param savedPaymentMethodId - Unique identifier of a saved payment method.
|
|
730
737
|
* @public
|
|
731
738
|
* @documentationMaturity preview
|
|
@@ -245,7 +245,20 @@ function markSavedPaymentMethodPrimary(payload) {
|
|
|
245
245
|
data: payload,
|
|
246
246
|
host
|
|
247
247
|
}),
|
|
248
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
248
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
249
|
+
fallback: [
|
|
250
|
+
{
|
|
251
|
+
method: "POST",
|
|
252
|
+
url: resolveWixPaymentsSavedPaymentMethodsV1SavedPaymentMethodServiceUrl(
|
|
253
|
+
{
|
|
254
|
+
protoPath: "/v1/saved-payment-methods/{savedPaymentMethodId}/mark-primary",
|
|
255
|
+
data: payload,
|
|
256
|
+
host
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
data: payload
|
|
260
|
+
}
|
|
261
|
+
]
|
|
249
262
|
};
|
|
250
263
|
return metadata;
|
|
251
264
|
}
|