@bigcommerce/checkout-sdk 1.374.3 → 1.374.5
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/dist/checkout-button.js +1 -1
- package/dist/checkout-button.umd.js +1 -1
- package/dist/checkout-sdk.d.ts +160 -1
- package/dist/checkout-sdk.js +1 -1
- package/dist/checkout-sdk.js.map +1 -1
- package/dist/checkout-sdk.umd.js +1 -1
- package/dist/checkout-sdk.umd.js.map +1 -1
- package/docs/README.md +5 -1
- package/docs/interfaces/PayPalCommerceCreditPaymentInitializeOptions.md +133 -0
- package/docs/interfaces/PayPalCommercePaymentInitializeOptions.md +133 -0
- package/docs/interfaces/WithPayPalCommerceCreditPaymentInitializeOptions.md +22 -0
- package/docs/interfaces/WithPayPalCommercePaymentInitializeOptions.md +15 -0
- package/package.json +1 -1
package/docs/README.md
CHANGED
|
@@ -290,7 +290,9 @@
|
|
|
290
290
|
- [PayPalCommerceCreditButtonInitializeOptions](interfaces/PayPalCommerceCreditButtonInitializeOptions.md)
|
|
291
291
|
- [PayPalCommerceCreditCardsPaymentInitializeOptions](interfaces/PayPalCommerceCreditCardsPaymentInitializeOptions.md)
|
|
292
292
|
- [PayPalCommerceCreditCustomerInitializeOptions](interfaces/PayPalCommerceCreditCustomerInitializeOptions.md)
|
|
293
|
+
- [PayPalCommerceCreditPaymentInitializeOptions](interfaces/PayPalCommerceCreditPaymentInitializeOptions.md)
|
|
293
294
|
- [PayPalCommerceCustomerInitializeOptions](interfaces/PayPalCommerceCustomerInitializeOptions.md)
|
|
295
|
+
- [PayPalCommercePaymentInitializeOptions](interfaces/PayPalCommercePaymentInitializeOptions.md)
|
|
294
296
|
- [PayPalCommerceVenmoButtonInitializeOptions](interfaces/PayPalCommerceVenmoButtonInitializeOptions.md)
|
|
295
297
|
- [PayPalCommerceVenmoCustomerInitializeOptions](interfaces/PayPalCommerceVenmoCustomerInitializeOptions.md)
|
|
296
298
|
- [PayPalInstrument](interfaces/PayPalInstrument.md)
|
|
@@ -380,7 +382,9 @@
|
|
|
380
382
|
- [WithPayPalCommerceCreditButtonInitializeOptions](interfaces/WithPayPalCommerceCreditButtonInitializeOptions.md)
|
|
381
383
|
- [WithPayPalCommerceCreditCardsPaymentInitializeOptions](interfaces/WithPayPalCommerceCreditCardsPaymentInitializeOptions.md)
|
|
382
384
|
- [WithPayPalCommerceCreditCustomerInitializeOptions](interfaces/WithPayPalCommerceCreditCustomerInitializeOptions.md)
|
|
385
|
+
- [WithPayPalCommerceCreditPaymentInitializeOptions](interfaces/WithPayPalCommerceCreditPaymentInitializeOptions.md)
|
|
383
386
|
- [WithPayPalCommerceCustomerInitializeOptions](interfaces/WithPayPalCommerceCustomerInitializeOptions.md)
|
|
387
|
+
- [WithPayPalCommercePaymentInitializeOptions](interfaces/WithPayPalCommercePaymentInitializeOptions.md)
|
|
384
388
|
- [WithPayPalCommerceVenmoButtonInitializeOptions](interfaces/WithPayPalCommerceVenmoButtonInitializeOptions.md)
|
|
385
389
|
- [WithPayPalCommerceVenmoCustomerInitializeOptions](interfaces/WithPayPalCommerceVenmoCustomerInitializeOptions.md)
|
|
386
390
|
- [WithSquareV2PaymentInitializeOptions](interfaces/WithSquareV2PaymentInitializeOptions.md)
|
|
@@ -705,7 +709,7 @@ ___
|
|
|
705
709
|
|
|
706
710
|
### PaymentInitializeOptions
|
|
707
711
|
|
|
708
|
-
Ƭ **PaymentInitializeOptions**: [`BasePaymentInitializeOptions`](interfaces/BasePaymentInitializeOptions.md) & [`WithAdyenV2PaymentInitializeOptions`](interfaces/WithAdyenV2PaymentInitializeOptions.md) & [`WithAdyenV3PaymentInitializeOptions`](interfaces/WithAdyenV3PaymentInitializeOptions.md) & [`WithApplePayPaymentInitializeOptions`](interfaces/WithApplePayPaymentInitializeOptions.md) & [`WithBoltPaymentInitializeOptions`](interfaces/WithBoltPaymentInitializeOptions.md) & [`WithCreditCardPaymentInitializeOptions`](interfaces/WithCreditCardPaymentInitializeOptions.md) & [`WithPayPalCommerceCreditCardsPaymentInitializeOptions`](interfaces/WithPayPalCommerceCreditCardsPaymentInitializeOptions.md) & [`WithSquareV2PaymentInitializeOptions`](interfaces/WithSquareV2PaymentInitializeOptions.md)
|
|
712
|
+
Ƭ **PaymentInitializeOptions**: [`BasePaymentInitializeOptions`](interfaces/BasePaymentInitializeOptions.md) & [`WithAdyenV2PaymentInitializeOptions`](interfaces/WithAdyenV2PaymentInitializeOptions.md) & [`WithAdyenV3PaymentInitializeOptions`](interfaces/WithAdyenV3PaymentInitializeOptions.md) & [`WithApplePayPaymentInitializeOptions`](interfaces/WithApplePayPaymentInitializeOptions.md) & [`WithBoltPaymentInitializeOptions`](interfaces/WithBoltPaymentInitializeOptions.md) & [`WithCreditCardPaymentInitializeOptions`](interfaces/WithCreditCardPaymentInitializeOptions.md) & [`WithPayPalCommercePaymentInitializeOptions`](interfaces/WithPayPalCommercePaymentInitializeOptions.md) & [`WithPayPalCommerceCreditPaymentInitializeOptions`](interfaces/WithPayPalCommerceCreditPaymentInitializeOptions.md) & [`WithPayPalCommerceCreditCardsPaymentInitializeOptions`](interfaces/WithPayPalCommerceCreditCardsPaymentInitializeOptions.md) & [`WithSquareV2PaymentInitializeOptions`](interfaces/WithSquareV2PaymentInitializeOptions.md)
|
|
709
713
|
|
|
710
714
|
___
|
|
711
715
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
[@bigcommerce/checkout-sdk](../README.md) / PayPalCommerceCreditPaymentInitializeOptions
|
|
2
|
+
|
|
3
|
+
# Interface: PayPalCommerceCreditPaymentInitializeOptions
|
|
4
|
+
|
|
5
|
+
A set of options that are required to initialize the PayPal Commerce payment
|
|
6
|
+
method for presenting its PayPal button.
|
|
7
|
+
|
|
8
|
+
Please note that the minimum version of checkout-sdk is 1.100
|
|
9
|
+
|
|
10
|
+
Also, PayPal (also known as PayPal Commerce Platform) requires specific options to initialize the PayPal Smart Payment Button on checkout page that substitutes a standard submit button
|
|
11
|
+
```html
|
|
12
|
+
<!-- This is where the PayPal button will be inserted -->
|
|
13
|
+
<div id="container"></div>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
service.initializePayment({
|
|
18
|
+
methodId: 'paypalcommercecredit',
|
|
19
|
+
paypalcommercecredit: {
|
|
20
|
+
container: '#container',
|
|
21
|
+
// Callback for submitting payment form that gets called when a buyer approves PayPal payment
|
|
22
|
+
submitForm: () => {
|
|
23
|
+
// Example function
|
|
24
|
+
this.submitOrder(
|
|
25
|
+
{
|
|
26
|
+
payment: { methodId: 'paypalcommercecredit', }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
// Callback is used to define the state of the payment form, validate if it is applicable for submit.
|
|
31
|
+
onValidate: (resolve, reject) => {
|
|
32
|
+
// Example function
|
|
33
|
+
const isValid = this.validatePaymentForm();
|
|
34
|
+
if (isValid) {
|
|
35
|
+
return resolve();
|
|
36
|
+
}
|
|
37
|
+
return reject();
|
|
38
|
+
},
|
|
39
|
+
// Callback that is called right before render of a Smart Payment Button. It gets called when a buyer is eligible for use of the particular PayPal method. This callback can be used to hide the standard submit button.
|
|
40
|
+
onRenderButton: () => {
|
|
41
|
+
// Example function
|
|
42
|
+
this.hidePaymentSubmitButton();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Table of contents
|
|
49
|
+
|
|
50
|
+
### Properties
|
|
51
|
+
|
|
52
|
+
- [container](PayPalCommerceCreditPaymentInitializeOptions.md#container)
|
|
53
|
+
|
|
54
|
+
### Methods
|
|
55
|
+
|
|
56
|
+
- [onError](PayPalCommerceCreditPaymentInitializeOptions.md#onerror)
|
|
57
|
+
- [onRenderButton](PayPalCommerceCreditPaymentInitializeOptions.md#onrenderbutton)
|
|
58
|
+
- [onValidate](PayPalCommerceCreditPaymentInitializeOptions.md#onvalidate)
|
|
59
|
+
- [submitForm](PayPalCommerceCreditPaymentInitializeOptions.md#submitform)
|
|
60
|
+
|
|
61
|
+
## Properties
|
|
62
|
+
|
|
63
|
+
### container
|
|
64
|
+
|
|
65
|
+
• **container**: `string`
|
|
66
|
+
|
|
67
|
+
The CSS selector of a container where the payment widget should be inserted into.
|
|
68
|
+
|
|
69
|
+
## Methods
|
|
70
|
+
|
|
71
|
+
### onError
|
|
72
|
+
|
|
73
|
+
▸ `Optional` **onError**(`error`): `void`
|
|
74
|
+
|
|
75
|
+
A callback for displaying error popup. This callback requires error object as parameter.
|
|
76
|
+
|
|
77
|
+
#### Parameters
|
|
78
|
+
|
|
79
|
+
| Name | Type |
|
|
80
|
+
| :------ | :------ |
|
|
81
|
+
| `error` | `Error` |
|
|
82
|
+
|
|
83
|
+
#### Returns
|
|
84
|
+
|
|
85
|
+
`void`
|
|
86
|
+
|
|
87
|
+
___
|
|
88
|
+
|
|
89
|
+
### onRenderButton
|
|
90
|
+
|
|
91
|
+
▸ `Optional` **onRenderButton**(): `void`
|
|
92
|
+
|
|
93
|
+
A callback right before render Smart Payment Button that gets called when
|
|
94
|
+
Smart Payment Button is eligible. This callback can be used to hide the standard submit button.
|
|
95
|
+
|
|
96
|
+
#### Returns
|
|
97
|
+
|
|
98
|
+
`void`
|
|
99
|
+
|
|
100
|
+
___
|
|
101
|
+
|
|
102
|
+
### onValidate
|
|
103
|
+
|
|
104
|
+
▸ **onValidate**(`resolve`, `reject`): `Promise`<`void`\>
|
|
105
|
+
|
|
106
|
+
A callback that gets called when a buyer click on Smart Payment Button
|
|
107
|
+
and should validate payment form.
|
|
108
|
+
|
|
109
|
+
#### Parameters
|
|
110
|
+
|
|
111
|
+
| Name | Type | Description |
|
|
112
|
+
| :------ | :------ | :------ |
|
|
113
|
+
| `resolve` | () => `void` | A function, that gets called if form is valid. |
|
|
114
|
+
| `reject` | () => `void` | A function, that gets called if form is not valid. |
|
|
115
|
+
|
|
116
|
+
#### Returns
|
|
117
|
+
|
|
118
|
+
`Promise`<`void`\>
|
|
119
|
+
|
|
120
|
+
reject() or resolve()
|
|
121
|
+
|
|
122
|
+
___
|
|
123
|
+
|
|
124
|
+
### submitForm
|
|
125
|
+
|
|
126
|
+
▸ **submitForm**(): `void`
|
|
127
|
+
|
|
128
|
+
A callback for submitting payment form that gets called
|
|
129
|
+
when buyer approved PayPal account.
|
|
130
|
+
|
|
131
|
+
#### Returns
|
|
132
|
+
|
|
133
|
+
`void`
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
[@bigcommerce/checkout-sdk](../README.md) / PayPalCommercePaymentInitializeOptions
|
|
2
|
+
|
|
3
|
+
# Interface: PayPalCommercePaymentInitializeOptions
|
|
4
|
+
|
|
5
|
+
A set of options that are required to initialize the PayPal Commerce payment
|
|
6
|
+
method for presenting its PayPal button.
|
|
7
|
+
|
|
8
|
+
Please note that the minimum version of checkout-sdk is 1.100
|
|
9
|
+
|
|
10
|
+
Also, PayPal (also known as PayPal Commerce Platform) requires specific options to initialize the PayPal Smart Payment Button on checkout page that substitutes a standard submit button
|
|
11
|
+
```html
|
|
12
|
+
<!-- This is where the PayPal button will be inserted -->
|
|
13
|
+
<div id="container"></div>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
service.initializePayment({
|
|
18
|
+
methodId: 'paypalcommerce',
|
|
19
|
+
paypalcommerce: {
|
|
20
|
+
container: '#container',
|
|
21
|
+
// Callback for submitting payment form that gets called when a buyer approves PayPal payment
|
|
22
|
+
submitForm: () => {
|
|
23
|
+
// Example function
|
|
24
|
+
this.submitOrder(
|
|
25
|
+
{
|
|
26
|
+
payment: { methodId: 'paypalcommerce', }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
// Callback is used to define the state of the payment form, validate if it is applicable for submit.
|
|
31
|
+
onValidate: (resolve, reject) => {
|
|
32
|
+
// Example function
|
|
33
|
+
const isValid = this.validatePaymentForm();
|
|
34
|
+
if (isValid) {
|
|
35
|
+
return resolve();
|
|
36
|
+
}
|
|
37
|
+
return reject();
|
|
38
|
+
},
|
|
39
|
+
// Callback that is called right before render of a Smart Payment Button. It gets called when a buyer is eligible for use of the particular PayPal method. This callback can be used to hide the standard submit button.
|
|
40
|
+
onRenderButton: () => {
|
|
41
|
+
// Example function
|
|
42
|
+
this.hidePaymentSubmitButton();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Table of contents
|
|
49
|
+
|
|
50
|
+
### Properties
|
|
51
|
+
|
|
52
|
+
- [container](PayPalCommercePaymentInitializeOptions.md#container)
|
|
53
|
+
|
|
54
|
+
### Methods
|
|
55
|
+
|
|
56
|
+
- [onError](PayPalCommercePaymentInitializeOptions.md#onerror)
|
|
57
|
+
- [onRenderButton](PayPalCommercePaymentInitializeOptions.md#onrenderbutton)
|
|
58
|
+
- [onValidate](PayPalCommercePaymentInitializeOptions.md#onvalidate)
|
|
59
|
+
- [submitForm](PayPalCommercePaymentInitializeOptions.md#submitform)
|
|
60
|
+
|
|
61
|
+
## Properties
|
|
62
|
+
|
|
63
|
+
### container
|
|
64
|
+
|
|
65
|
+
• **container**: `string`
|
|
66
|
+
|
|
67
|
+
The CSS selector of a container where the payment widget should be inserted into.
|
|
68
|
+
|
|
69
|
+
## Methods
|
|
70
|
+
|
|
71
|
+
### onError
|
|
72
|
+
|
|
73
|
+
▸ `Optional` **onError**(`error`): `void`
|
|
74
|
+
|
|
75
|
+
A callback for displaying error popup. This callback requires error object as parameter.
|
|
76
|
+
|
|
77
|
+
#### Parameters
|
|
78
|
+
|
|
79
|
+
| Name | Type |
|
|
80
|
+
| :------ | :------ |
|
|
81
|
+
| `error` | `Error` |
|
|
82
|
+
|
|
83
|
+
#### Returns
|
|
84
|
+
|
|
85
|
+
`void`
|
|
86
|
+
|
|
87
|
+
___
|
|
88
|
+
|
|
89
|
+
### onRenderButton
|
|
90
|
+
|
|
91
|
+
▸ `Optional` **onRenderButton**(): `void`
|
|
92
|
+
|
|
93
|
+
A callback right before render Smart Payment Button that gets called when
|
|
94
|
+
Smart Payment Button is eligible. This callback can be used to hide the standard submit button.
|
|
95
|
+
|
|
96
|
+
#### Returns
|
|
97
|
+
|
|
98
|
+
`void`
|
|
99
|
+
|
|
100
|
+
___
|
|
101
|
+
|
|
102
|
+
### onValidate
|
|
103
|
+
|
|
104
|
+
▸ **onValidate**(`resolve`, `reject`): `Promise`<`void`\>
|
|
105
|
+
|
|
106
|
+
A callback that gets called when a buyer click on Smart Payment Button
|
|
107
|
+
and should validate payment form.
|
|
108
|
+
|
|
109
|
+
#### Parameters
|
|
110
|
+
|
|
111
|
+
| Name | Type | Description |
|
|
112
|
+
| :------ | :------ | :------ |
|
|
113
|
+
| `resolve` | () => `void` | A function, that gets called if form is valid. |
|
|
114
|
+
| `reject` | () => `void` | A function, that gets called if form is not valid. |
|
|
115
|
+
|
|
116
|
+
#### Returns
|
|
117
|
+
|
|
118
|
+
`Promise`<`void`\>
|
|
119
|
+
|
|
120
|
+
reject() or resolve()
|
|
121
|
+
|
|
122
|
+
___
|
|
123
|
+
|
|
124
|
+
### submitForm
|
|
125
|
+
|
|
126
|
+
▸ **submitForm**(): `void`
|
|
127
|
+
|
|
128
|
+
A callback for submitting payment form that gets called
|
|
129
|
+
when buyer approved PayPal account.
|
|
130
|
+
|
|
131
|
+
#### Returns
|
|
132
|
+
|
|
133
|
+
`void`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[@bigcommerce/checkout-sdk](../README.md) / WithPayPalCommerceCreditPaymentInitializeOptions
|
|
2
|
+
|
|
3
|
+
# Interface: WithPayPalCommerceCreditPaymentInitializeOptions
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [paypalcommerce](WithPayPalCommerceCreditPaymentInitializeOptions.md#paypalcommerce)
|
|
10
|
+
- [paypalcommercecredit](WithPayPalCommerceCreditPaymentInitializeOptions.md#paypalcommercecredit)
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### paypalcommerce
|
|
15
|
+
|
|
16
|
+
• `Optional` **paypalcommerce**: [`PayPalCommerceCreditPaymentInitializeOptions`](PayPalCommerceCreditPaymentInitializeOptions.md)
|
|
17
|
+
|
|
18
|
+
___
|
|
19
|
+
|
|
20
|
+
### paypalcommercecredit
|
|
21
|
+
|
|
22
|
+
• `Optional` **paypalcommercecredit**: [`PayPalCommerceCreditPaymentInitializeOptions`](PayPalCommerceCreditPaymentInitializeOptions.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[@bigcommerce/checkout-sdk](../README.md) / WithPayPalCommercePaymentInitializeOptions
|
|
2
|
+
|
|
3
|
+
# Interface: WithPayPalCommercePaymentInitializeOptions
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [paypalcommerce](WithPayPalCommercePaymentInitializeOptions.md#paypalcommerce)
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### paypalcommerce
|
|
14
|
+
|
|
15
|
+
• `Optional` **paypalcommerce**: [`PayPalCommercePaymentInitializeOptions`](PayPalCommercePaymentInitializeOptions.md)
|