@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.207",
3
+ "version": "5.0.208",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -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,
@@ -203,6 +203,11 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
203
203
  required: false
204
204
  },
205
205
 
206
+ onComplete: {
207
+ type: 'function',
208
+ required: false
209
+ },
210
+
206
211
  onShippingChange: {
207
212
  type: 'function',
208
213
  required: false,
@@ -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
@@ -103,6 +103,11 @@ export function getCardFormComponent() : CardFormComponent {
103
103
  alias: 'onAuthorize'
104
104
  },
105
105
 
106
+ onComplete: {
107
+ type: 'function',
108
+ required: false
109
+ },
110
+
106
111
  onAuth: {
107
112
  type: 'function',
108
113
  required: false,
@@ -191,6 +191,11 @@ export function getCheckoutComponent() : CheckoutComponent {
191
191
  type: 'function',
192
192
  alias: 'onAuthorize'
193
193
  },
194
+
195
+ onComplete: {
196
+ type: 'function',
197
+ required: false
198
+ },
194
199
 
195
200
  onShippingChange: {
196
201
  type: 'function',
@@ -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>,