@paypal/checkout-components 5.0.207 → 5.0.208
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/CHANGELOG.md +6 -0
- package/dist/button.js +1 -1
- package/package.json +1 -1
- package/src/ui/buttons/props.js +8 -0
- package/src/zoid/buttons/component.jsx +5 -0
- package/src/zoid/card-fields/component.jsx +12 -0
- package/src/zoid/card-form/component.js +5 -0
- package/src/zoid/checkout/component.jsx +5 -0
- package/src/zoid/checkout/props.js +6 -0
package/package.json
CHANGED
package/src/ui/buttons/props.js
CHANGED
|
@@ -36,6 +36,8 @@ export type OnApproveData = {|
|
|
|
36
36
|
paymentID? : string
|
|
37
37
|
|};
|
|
38
38
|
|
|
39
|
+
export type OnCompleteData = {||};
|
|
40
|
+
|
|
39
41
|
export type CreateBillingAgreement = () => ZalgoPromise<string> | string;
|
|
40
42
|
|
|
41
43
|
export type CreateSubscriptionRequest = {||};
|
|
@@ -65,7 +67,12 @@ export type OnApproveActions = {|
|
|
|
65
67
|
|}
|
|
66
68
|
|};
|
|
67
69
|
|
|
70
|
+
export type OnCompleteActions = {|
|
|
71
|
+
redirect : (string, CrossDomainWindowType) => ZalgoPromise<void>
|
|
72
|
+
|};
|
|
73
|
+
|
|
68
74
|
export type OnApprove = (data : OnApproveData, actions : OnApproveActions) => ZalgoPromise<void> | void;
|
|
75
|
+
export type OnComplete = (data : OnCompleteData, actions : OnCompleteActions) => ZalgoPromise<void> | void;
|
|
69
76
|
|
|
70
77
|
type OnShippingChangeAddress = {|
|
|
71
78
|
city : string,
|
|
@@ -283,6 +290,7 @@ export type ButtonProps = {|
|
|
|
283
290
|
createSubscription : CreateSubscription,
|
|
284
291
|
oncancel : OnCancel,
|
|
285
292
|
onApprove : OnApprove,
|
|
293
|
+
onComplete : OnComplete,
|
|
286
294
|
onClick : OnClick,
|
|
287
295
|
getPrerenderDetails : GetPrerenderDetails,
|
|
288
296
|
style : ButtonStyle,
|
|
@@ -47,6 +47,7 @@ type CardFieldsProps = {|
|
|
|
47
47
|
|
|
48
48
|
createOrder : () => ZalgoPromise<string> | string,
|
|
49
49
|
onApprove : ({| returnUrl : string |}, {| redirect : (?CrossDomainWindowType, ?string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>,
|
|
50
|
+
onComplete : ({| returnUrl : string |}, {| redirect : (?CrossDomainWindowType, ?string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>,
|
|
50
51
|
onCancel ? : ({| cancelUrl : string |}, {| redirect : (? CrossDomainWindowType, ? string) => ZalgoPromise<void> |}) => ?ZalgoPromise<void>
|
|
51
52
|
|};
|
|
52
53
|
|
|
@@ -165,6 +166,12 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
|
|
|
165
166
|
value: ({ props }) => props.parent.props.onApprove
|
|
166
167
|
},
|
|
167
168
|
|
|
169
|
+
onComplete: {
|
|
170
|
+
type: 'function',
|
|
171
|
+
required: false,
|
|
172
|
+
value: ({ props }) => props.parent.props.onComplete
|
|
173
|
+
},
|
|
174
|
+
|
|
168
175
|
onCancel: {
|
|
169
176
|
type: 'function',
|
|
170
177
|
required: false,
|
|
@@ -336,6 +343,11 @@ export const getCardFieldsComponent : () => CardFieldsComponent = memoize(() : C
|
|
|
336
343
|
required: false
|
|
337
344
|
},
|
|
338
345
|
|
|
346
|
+
onComplete: {
|
|
347
|
+
type: 'function',
|
|
348
|
+
required: false
|
|
349
|
+
},
|
|
350
|
+
|
|
339
351
|
onCancel: {
|
|
340
352
|
type: 'function',
|
|
341
353
|
required: false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
3
|
import type { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
|
|
4
|
+
import type { CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
|
|
4
5
|
import { FUNDING, ENV, type LocaleType } from '@paypal/sdk-constants/src';
|
|
5
6
|
|
|
6
7
|
export type OnApproveData = {|
|
|
@@ -13,6 +14,10 @@ export type OnApproveActions = {|
|
|
|
13
14
|
|
|
14
15
|
|};
|
|
15
16
|
|
|
17
|
+
export type OnCompleteData = {||};
|
|
18
|
+
export type OnCompleteActions = {|
|
|
19
|
+
redirect : (string, CrossDomainWindowType) => ZalgoPromise<void>
|
|
20
|
+
|};
|
|
16
21
|
export type OnCancelData = {|
|
|
17
22
|
orderID : string,
|
|
18
23
|
paymentID? : string
|
|
@@ -26,6 +31,7 @@ export type CheckoutPropsType = {|
|
|
|
26
31
|
createOrder : () => ZalgoPromise<string>,
|
|
27
32
|
createAuthCode : () => ZalgoPromise<string>,
|
|
28
33
|
onApprove : (OnApproveData, OnApproveActions) => ?ZalgoPromise<void>,
|
|
34
|
+
onComplete : (OnCompleteData, OnCompleteActions) => ?ZalgoPromise<void>,
|
|
29
35
|
onCancel? : (OnCancelData, OnCancelActions) => ?ZalgoPromise<void>,
|
|
30
36
|
fundingSource : $Values<typeof FUNDING>,
|
|
31
37
|
env : $Values<typeof ENV>,
|