@paypal/checkout-components 5.0.297-alpha.0 → 5.0.297

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.
@@ -39,6 +39,7 @@ import {
39
39
  getDisableSetCookie,
40
40
  getExperimentation,
41
41
  getSDKAttribute,
42
+ getSDKIntegrationSource,
42
43
  } from "@paypal/sdk-client/src";
43
44
  import {
44
45
  rememberFunding,
@@ -251,124 +252,121 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
251
252
  },
252
253
 
253
254
  props: {
254
- /**
255
- * Version of the SDK used in first render.
256
- * This is passed to the `/smart/buttons` endpoint in order for the second render
257
- * to be aware of what sdk version to load during SSR of the buttons
258
- */
259
- sdkVersion: {
260
- type: "string",
255
+ // allowBillingPayments prop is used by Honey Extension to render the one-click button
256
+ // with payment methods & to use the payment methods instead of the Billing Agreement
257
+ allowBillingPayments: {
258
+ type: "boolean",
261
259
  queryParam: true,
262
- sendToChild: false,
263
- value: getVersion,
260
+ required: false,
261
+ default: () => true,
264
262
  },
265
- fundingSource: {
263
+
264
+ amount: {
266
265
  type: "string",
267
- queryParam: true,
268
266
  required: false,
267
+ queryParam: true,
268
+ value: getAmount,
269
+ },
269
270
 
270
- validate: ({ props }) => {
271
- const {
272
- fundingSource,
273
- onShippingChange,
274
- onShippingAddressChange,
275
- onShippingOptionsChange,
276
- style = {},
277
- fundingEligibility = getRefinedFundingEligibility(),
278
- enableFunding = getEnableFunding(),
279
- applePaySupport,
280
- supportsPopups,
281
- supportedNativeBrowser,
282
- createBillingAgreement,
283
- createSubscription,
284
- createVaultSetupToken,
285
- } = props;
286
-
287
- const flow = determineFlow({
288
- createBillingAgreement,
289
- createSubscription,
290
- createVaultSetupToken,
291
- });
292
- const { layout } = style;
271
+ apiStageHost: {
272
+ type: "string",
273
+ value: getAPIStageHost,
274
+ required: false,
275
+ },
293
276
 
294
- const platform = getPlatform();
295
- const components = getComponents();
277
+ applePay: {
278
+ type: "function",
279
+ required: false,
280
+ value: applePaySession,
281
+ },
296
282
 
297
- if (
298
- fundingSource &&
299
- !isFundingEligible(fundingSource, {
300
- layout,
301
- platform,
302
- fundingSource,
303
- fundingEligibility,
304
- enableFunding,
305
- components,
306
- onShippingChange,
307
- onShippingAddressChange,
308
- onShippingOptionsChange,
309
- flow,
310
- applePaySupport,
311
- supportsPopups,
312
- supportedNativeBrowser,
313
- })
314
- ) {
315
- throw new Error(`${fundingSource} is not eligible`);
316
- }
283
+ applePaySupport: {
284
+ type: "boolean",
285
+ value: ({ props }) => {
286
+ return props?.fundingEligibility?.applepay?.eligible
287
+ ? isApplePaySupported()
288
+ : false;
317
289
  },
290
+ queryParam: true,
318
291
  },
319
292
 
320
- style: {
321
- type: "object",
293
+ branded: {
294
+ type: "boolean",
322
295
  queryParam: true,
323
296
  required: false,
324
- decorate: ({ props, value }) => {
325
- // $FlowFixMe
326
- return normalizeButtonStyle(props, value);
327
- },
297
+ },
328
298
 
329
- validate: ({ props, value = {} }) => {
330
- // $FlowFixMe
331
- normalizeButtonStyle(props, value);
332
- },
299
+ buttonLocation: {
300
+ type: "string",
301
+ value: () => window.location.hostname,
302
+ queryParam: false,
303
+ },
333
304
 
334
- default: () => ({}),
305
+ buttonSessionID: {
306
+ type: "string",
307
+ value: uniqueID,
308
+ queryParam: true,
335
309
  },
336
310
 
337
- storageState: {
338
- type: "object",
339
- value: () => storageState,
311
+ buttonSize: {
312
+ type: "string",
313
+ required: false,
314
+ value: ({ props, container }) => {
315
+ return getButtonSize(props, container);
316
+ },
317
+ queryParam: true,
340
318
  },
341
319
 
342
- sessionState: {
343
- type: "object",
344
- value: () => sessionState,
320
+ buyerCountry: {
321
+ type: "string",
322
+ queryParam: true,
323
+ required: false,
324
+ value: getBuyerCountry,
345
325
  },
346
326
 
347
- components: {
348
- type: "array",
327
+ clientAccessToken: {
328
+ type: "string",
329
+ required: false,
349
330
  queryParam: true,
350
- value: getComponents,
331
+ value: getClientAccessToken,
351
332
  },
352
333
 
353
- locale: {
354
- type: "object",
334
+ clientID: {
335
+ type: "string",
336
+ value: getClientID,
355
337
  queryParam: true,
356
- value: getLocale,
357
338
  },
358
339
 
359
- sdkMeta: {
340
+ clientMetadataID: {
360
341
  type: "string",
342
+ required: false,
343
+ default: () => {
344
+ const clientMetadataId = getClientMetadataID();
345
+ const sessionID = getSessionID();
346
+
347
+ return clientMetadataId || sessionID;
348
+ },
361
349
  queryParam: true,
362
- sendToChild: false,
363
- value: getSDKMeta,
364
350
  },
365
351
 
366
- createOrder: {
352
+ commit: {
353
+ type: "boolean",
354
+ queryParam: true,
355
+ value: getCommit,
356
+ },
357
+
358
+ components: {
359
+ type: "array",
360
+ queryParam: true,
361
+ value: getComponents,
362
+ },
363
+
364
+ createBillingAgreement: {
367
365
  type: "function",
368
366
  required: false,
369
367
  },
370
368
 
371
- createBillingAgreement: {
369
+ createOrder: {
372
370
  type: "function",
373
371
  required: false,
374
372
  },
@@ -378,51 +376,185 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
378
376
  required: false,
379
377
  },
380
378
 
381
- onApprove: {
379
+ createVaultSetupToken: {
382
380
  type: "function",
383
381
  required: false,
384
382
  },
385
383
 
386
- onComplete: {
387
- type: "function",
384
+ csp: {
385
+ type: "object",
388
386
  required: false,
387
+ value: () => {
388
+ return {
389
+ nonce: getCSPNonce(),
390
+ };
391
+ },
389
392
  },
390
393
 
391
- onShippingChange: {
392
- type: "function",
394
+ currency: {
395
+ type: "string",
396
+ queryParam: true,
397
+ value: getCurrency,
398
+ },
399
+
400
+ debug: {
401
+ type: "boolean",
402
+ value: getDebug,
403
+ queryParam: true,
404
+ },
405
+
406
+ disableCard: {
407
+ type: "array",
408
+ queryParam: true,
409
+ value: getDisableCard,
410
+ },
411
+
412
+ disableFunding: {
413
+ type: "array",
414
+ queryParam: true,
415
+ value: getDisableFunding,
416
+ },
417
+
418
+ disableSetCookie: {
419
+ type: "boolean",
420
+ queryParam: true,
393
421
  required: false,
422
+ value: getDisableSetCookie,
423
+ },
424
+
425
+ displayOnly: {
426
+ type: "array",
394
427
  queryParam: true,
395
- queryValue: ({ value }) => {
396
- return value ? QUERY_BOOL.TRUE : QUERY_BOOL.FALSE;
428
+ required: false,
429
+ value: ({ props }) => {
430
+ return props?.displayOnly || [];
397
431
  },
398
432
  },
399
433
 
400
- onShippingAddressChange: {
401
- type: "function",
402
- required: false,
434
+ enableFunding: {
435
+ type: "array",
436
+ queryParam: true,
437
+ value: getEnableFunding,
403
438
  },
404
439
 
405
- onShippingOptionsChange: {
406
- type: "function",
440
+ enableThreeDomainSecure: {
441
+ type: "boolean",
442
+ value: getEnableThreeDomainSecure,
443
+ },
444
+
445
+ enableVault: {
446
+ type: "boolean",
407
447
  required: false,
448
+ queryParam: true,
408
449
  },
409
450
 
410
- onCancel: {
411
- type: "function",
451
+ env: {
452
+ type: "string",
453
+ queryParam: true,
454
+ value: getEnv,
455
+ },
456
+
457
+ experiment: {
458
+ type: "object",
459
+ queryParam: true,
460
+ value: () => {
461
+ const experiments = getButtonExperiments();
462
+ return experiments;
463
+ },
464
+ },
465
+
466
+ experimentation: {
467
+ type: "object",
468
+ queryParam: true,
412
469
  required: false,
470
+ value: getExperimentation,
413
471
  },
414
472
 
415
- onClick: {
416
- type: "function",
473
+ flow: {
474
+ type: "string",
475
+ queryParam: true,
476
+ value: ({ props }) => {
477
+ const {
478
+ createBillingAgreement,
479
+ createSubscription,
480
+ createVaultSetupToken,
481
+ } = props;
482
+ return determineFlow({
483
+ createBillingAgreement,
484
+ createSubscription,
485
+ createVaultSetupToken,
486
+ });
487
+ },
488
+ },
489
+
490
+ fundingEligibility: {
491
+ type: "object",
492
+ default: getRefinedFundingEligibility,
493
+ value: __ENV__ === ENV.LOCAL ? undefined : getRefinedFundingEligibility,
494
+ queryParam: true,
495
+ serialization: "base64",
496
+ },
497
+
498
+ fundingSource: {
499
+ type: "string",
500
+ queryParam: true,
417
501
  required: false,
502
+
503
+ validate: ({ props }) => {
504
+ const {
505
+ fundingSource,
506
+ onShippingChange,
507
+ onShippingAddressChange,
508
+ onShippingOptionsChange,
509
+ style = {},
510
+ fundingEligibility = getRefinedFundingEligibility(),
511
+ enableFunding = getEnableFunding(),
512
+ applePaySupport,
513
+ supportsPopups,
514
+ supportedNativeBrowser,
515
+ createBillingAgreement,
516
+ createSubscription,
517
+ createVaultSetupToken,
518
+ } = props;
519
+
520
+ const flow = determineFlow({
521
+ createBillingAgreement,
522
+ createSubscription,
523
+ createVaultSetupToken,
524
+ });
525
+ const { layout } = style;
526
+
527
+ const platform = getPlatform();
528
+ const components = getComponents();
529
+
530
+ if (
531
+ fundingSource &&
532
+ !isFundingEligible(fundingSource, {
533
+ layout,
534
+ platform,
535
+ fundingSource,
536
+ fundingEligibility,
537
+ enableFunding,
538
+ components,
539
+ onShippingChange,
540
+ onShippingAddressChange,
541
+ onShippingOptionsChange,
542
+ flow,
543
+ applePaySupport,
544
+ supportsPopups,
545
+ supportedNativeBrowser,
546
+ })
547
+ ) {
548
+ throw new Error(`${fundingSource} is not eligible`);
549
+ }
550
+ },
418
551
  },
419
552
 
420
- getPrerenderDetails: {
553
+ getPageUrl: {
421
554
  type: "function",
422
- value:
423
- ({ state }) =>
424
- () =>
425
- state.prerenderDetails,
555
+ value: () => {
556
+ return () => window.location.href;
557
+ },
426
558
  },
427
559
 
428
560
  getPopupBridge: {
@@ -451,28 +583,12 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
451
583
  },
452
584
  },
453
585
 
454
- onInit: {
586
+ getPrerenderDetails: {
455
587
  type: "function",
456
- required: false,
457
- default: () => noop,
458
- decorate: ({ props, value = noop }) => {
459
- logLatencyInstrumentationPhase({
460
- buttonSessionID: props.buttonSessionID,
461
- phase: "buttons-first-render",
462
- });
463
-
464
- return (...args) => {
465
- const venmoExperiment = createVenmoExperiment();
466
-
467
- if (venmoExperiment) {
468
- venmoExperiment.logStart({
469
- [FPTI_KEY.BUTTON_SESSION_UID]: props.buttonSessionID,
470
- });
471
- }
472
-
473
- return value(...args);
474
- };
475
- },
588
+ value:
589
+ ({ state }) =>
590
+ () =>
591
+ state.prerenderDetails,
476
592
  },
477
593
 
478
594
  getQueriedEligibleFunding: {
@@ -482,220 +598,163 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
482
598
  },
483
599
  },
484
600
 
485
- clientID: {
486
- type: "string",
487
- value: getClientID,
488
- queryParam: true,
489
- },
490
-
491
- clientAccessToken: {
492
- type: "string",
493
- required: false,
494
- queryParam: true,
495
- value: getClientAccessToken,
496
- },
497
-
498
- partnerAttributionID: {
499
- type: "string",
500
- required: false,
501
- value: getPartnerAttributionID,
502
- },
503
-
504
- merchantRequestedPopupsDisabled: {
505
- type: "boolean",
506
- required: false,
507
- value: getMerchantRequestedPopupsDisabled,
508
- },
509
-
510
- enableThreeDomainSecure: {
511
- type: "boolean",
512
- value: getEnableThreeDomainSecure,
513
- },
514
-
515
- sdkCorrelationID: {
601
+ hostedButtonId: {
516
602
  type: "string",
517
603
  required: false,
518
- value: getCorrelationID,
519
604
  queryParam: true,
520
605
  },
521
606
 
522
- storageID: {
607
+ intent: {
523
608
  type: "string",
524
- value: getStorageID,
525
609
  queryParam: true,
610
+ value: getIntent,
526
611
  },
527
612
 
528
- sessionID: {
529
- type: "string",
530
- value: getSessionID,
613
+ locale: {
614
+ type: "object",
531
615
  queryParam: true,
616
+ value: getLocale,
532
617
  },
533
618
 
534
- buttonLocation: {
535
- type: "string",
536
- value: () => window.location.hostname,
537
- queryParam: false,
538
- },
539
-
540
- buttonSessionID: {
541
- type: "string",
542
- value: uniqueID,
619
+ merchantID: {
620
+ type: "array",
543
621
  queryParam: true,
622
+ value: getMerchantID,
544
623
  },
545
624
 
546
- enableVault: {
625
+ merchantRequestedPopupsDisabled: {
547
626
  type: "boolean",
548
627
  required: false,
549
- queryParam: true,
628
+ value: getMerchantRequestedPopupsDisabled,
550
629
  },
551
630
 
552
- env: {
631
+ nonce: {
553
632
  type: "string",
554
- queryParam: true,
555
- value: getEnv,
633
+ default: getCSPNonce,
556
634
  },
557
635
 
558
- amount: {
559
- type: "string",
636
+ onApprove: {
637
+ type: "function",
560
638
  required: false,
561
- queryParam: true,
562
- value: getAmount,
563
639
  },
564
640
 
565
- stageHost: {
566
- type: "string",
567
- value: getStageHost,
641
+ onCancel: {
642
+ type: "function",
568
643
  required: false,
569
644
  },
570
645
 
571
- buttonSize: {
572
- type: "string",
646
+ onClick: {
647
+ type: "function",
573
648
  required: false,
574
- value: ({ props, container }) => {
575
- return getButtonSize(props, container);
576
- },
577
- queryParam: true,
578
649
  },
579
650
 
580
- apiStageHost: {
581
- type: "string",
582
- value: getAPIStageHost,
651
+ onComplete: {
652
+ type: "function",
583
653
  required: false,
584
654
  },
585
655
 
586
- fundingEligibility: {
587
- type: "object",
588
- default: getRefinedFundingEligibility,
589
- value: __ENV__ === ENV.LOCAL ? undefined : getRefinedFundingEligibility,
590
- queryParam: true,
591
- serialization: "base64",
592
- },
656
+ onInit: {
657
+ type: "function",
658
+ required: false,
659
+ default: () => noop,
660
+ decorate: ({ props, value = noop }) => {
661
+ logLatencyInstrumentationPhase({
662
+ buttonSessionID: props.buttonSessionID,
663
+ phase: "buttons-first-render",
664
+ });
593
665
 
594
- platform: {
595
- type: "string",
596
- queryParam: true,
597
- value: getPlatform,
598
- },
666
+ return (...args) => {
667
+ const venmoExperiment = createVenmoExperiment();
599
668
 
600
- remembered: {
601
- type: "array",
602
- queryParam: true,
603
- value: getRememberedFunding,
604
- },
669
+ if (venmoExperiment) {
670
+ venmoExperiment.logStart({
671
+ [FPTI_KEY.BUTTON_SESSION_UID]: props.buttonSessionID,
672
+ });
673
+ }
605
674
 
606
- experiment: {
607
- type: "object",
608
- queryParam: true,
609
- value: () => {
610
- const experiments = getButtonExperiments();
611
- return experiments;
675
+ return value(...args);
676
+ };
612
677
  },
613
678
  },
614
679
 
615
- paymentRequest: {
616
- type: "object",
617
- queryParam: false,
680
+ onShippingAddressChange: {
681
+ type: "function",
618
682
  required: false,
619
683
  },
620
684
 
621
- flow: {
622
- type: "string",
685
+ onShippingChange: {
686
+ type: "function",
687
+ required: false,
623
688
  queryParam: true,
624
- value: ({ props }) => {
625
- const {
626
- createBillingAgreement,
627
- createSubscription,
628
- createVaultSetupToken,
629
- } = props;
630
- return determineFlow({
631
- createBillingAgreement,
632
- createSubscription,
633
- createVaultSetupToken,
634
- });
689
+ queryValue: ({ value }) => {
690
+ return value ? QUERY_BOOL.TRUE : QUERY_BOOL.FALSE;
635
691
  },
636
692
  },
637
693
 
638
- remember: {
694
+ onShippingOptionsChange: {
639
695
  type: "function",
640
- value: () => {
641
- return (fundingSources: $ReadOnlyArray<$Values<typeof FUNDING>>) =>
642
- rememberFunding(fundingSources, { cookie: false });
643
- },
696
+ required: false,
644
697
  },
645
698
 
646
- currency: {
699
+ pageType: {
647
700
  type: "string",
701
+ required: false,
648
702
  queryParam: true,
649
- value: getCurrency,
703
+ value: () => getSDKAttribute(SDK_SETTINGS.PAGE_TYPE),
650
704
  },
651
705
 
652
- intent: {
706
+ partnerAttributionID: {
653
707
  type: "string",
654
- queryParam: true,
655
- value: getIntent,
708
+ required: false,
709
+ value: getPartnerAttributionID,
656
710
  },
657
711
 
658
- buyerCountry: {
712
+ paymentMethodNonce: {
659
713
  type: "string",
660
714
  queryParam: true,
661
715
  required: false,
662
- value: getBuyerCountry,
663
716
  },
664
717
 
665
- commit: {
666
- type: "boolean",
718
+ paymentMethodToken: {
719
+ type: "string",
667
720
  queryParam: true,
668
- value: getCommit,
721
+ required: false,
669
722
  },
670
723
 
671
- vault: {
672
- type: "boolean",
673
- queryParam: true,
674
- value: getVault,
724
+ paymentRequest: {
725
+ type: "object",
726
+ queryParam: false,
727
+ required: false,
675
728
  },
676
729
 
677
- enableFunding: {
678
- type: "array",
730
+ platform: {
731
+ type: "string",
679
732
  queryParam: true,
680
- value: getEnableFunding,
733
+ value: getPlatform,
681
734
  },
682
735
 
683
- disableFunding: {
684
- type: "array",
685
- queryParam: true,
686
- value: getDisableFunding,
736
+ referrerDomain: {
737
+ type: "string",
738
+ required: false,
739
+ value: () => {
740
+ if (window.document.referrer) {
741
+ return new URL(window.document.referrer).host || undefined;
742
+ }
743
+ },
687
744
  },
688
745
 
689
- disableCard: {
690
- type: "array",
691
- queryParam: true,
692
- value: getDisableCard,
746
+ remember: {
747
+ type: "function",
748
+ value: () => {
749
+ return (fundingSources: $ReadOnlyArray<$Values<typeof FUNDING>>) =>
750
+ rememberFunding(fundingSources, { cookie: false });
751
+ },
693
752
  },
694
753
 
695
- merchantID: {
754
+ remembered: {
696
755
  type: "array",
697
756
  queryParam: true,
698
- value: getMerchantID,
757
+ value: getRememberedFunding,
699
758
  },
700
759
 
701
760
  renderedButtons: {
@@ -704,104 +763,87 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
704
763
  value: ({ props }) => getRenderedButtons(props),
705
764
  },
706
765
 
707
- csp: {
708
- type: "object",
709
- required: false,
710
- value: () => {
711
- return {
712
- nonce: getCSPNonce(),
713
- };
714
- },
715
- },
716
-
717
- nonce: {
766
+ sessionID: {
718
767
  type: "string",
719
- default: getCSPNonce,
720
- },
721
-
722
- getPageUrl: {
723
- type: "function",
724
- value: () => {
725
- return () => window.location.href;
726
- },
768
+ value: getSessionID,
769
+ queryParam: true,
727
770
  },
728
771
 
729
- referrerDomain: {
772
+ sdkCorrelationID: {
730
773
  type: "string",
731
774
  required: false,
732
- value: () => {
733
- if (window.document.referrer) {
734
- return new URL(window.document.referrer).host || undefined;
735
- }
736
- },
775
+ value: getCorrelationID,
776
+ queryParam: true,
737
777
  },
738
778
 
739
- userIDToken: {
779
+ sdkIntegrationSource: {
740
780
  type: "string",
741
- default: getUserIDToken,
781
+ queryParam: true,
742
782
  required: false,
743
- queryParam: getEnv() !== ENV.LOCAL && getEnv() !== ENV.STAGE,
744
- bodyParam: getEnv() === ENV.LOCAL || getEnv() === ENV.STAGE,
783
+ value: getSDKIntegrationSource,
745
784
  },
746
785
 
747
- clientMetadataID: {
786
+ sdkMeta: {
748
787
  type: "string",
749
- required: false,
750
- default: () => {
751
- const clientMetadataId = getClientMetadataID();
752
- const sessionID = getSessionID();
753
-
754
- return clientMetadataId || sessionID;
755
- },
756
788
  queryParam: true,
789
+ sendToChild: false,
790
+ value: getSDKMeta,
757
791
  },
758
792
 
759
- debug: {
760
- type: "boolean",
761
- value: getDebug,
793
+ /**
794
+ * Version of the SDK used in first render.
795
+ * This is passed to the `/smart/buttons` endpoint in order for the second render
796
+ * to be aware of what sdk version to load during SSR of the buttons
797
+ */
798
+ sdkVersion: {
799
+ type: "string",
762
800
  queryParam: true,
801
+ sendToChild: false,
802
+ value: getVersion,
763
803
  },
764
804
 
765
- test: {
805
+ sessionState: {
766
806
  type: "object",
767
- default(): Object {
768
- return {
769
- action: "checkout",
770
- };
771
- },
807
+ value: () => sessionState,
772
808
  },
773
809
 
774
- wallet: {
775
- type: "object",
810
+ stageHost: {
811
+ type: "string",
812
+ value: getStageHost,
776
813
  required: false,
777
- default: () => window.__TEST_WALLET__,
778
814
  },
779
815
 
780
- paymentMethodNonce: {
816
+ storageID: {
781
817
  type: "string",
818
+ value: getStorageID,
782
819
  queryParam: true,
783
- required: false,
784
820
  },
785
821
 
786
- paymentMethodToken: {
787
- type: "string",
788
- queryParam: true,
789
- required: false,
822
+ storageState: {
823
+ type: "object",
824
+ value: () => storageState,
790
825
  },
791
826
 
792
- branded: {
793
- type: "boolean",
827
+ style: {
828
+ type: "object",
794
829
  queryParam: true,
795
830
  required: false,
831
+ decorate: ({ props, value }) => {
832
+ // $FlowFixMe
833
+ return normalizeButtonStyle(props, value);
834
+ },
835
+
836
+ validate: ({ props, value = {} }) => {
837
+ // $FlowFixMe
838
+ normalizeButtonStyle(props, value);
839
+ },
840
+
841
+ default: () => ({}),
796
842
  },
797
843
 
798
- applePaySupport: {
844
+ supportedNativeBrowser: {
799
845
  type: "boolean",
800
- value: ({ props }) => {
801
- return props?.fundingEligibility?.applepay?.eligible
802
- ? isApplePaySupported()
803
- : false;
804
- },
846
+ value: isSupportedNativeBrowser,
805
847
  queryParam: true,
806
848
  },
807
849
 
@@ -811,10 +853,13 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
811
853
  queryParam: true,
812
854
  },
813
855
 
814
- supportedNativeBrowser: {
815
- type: "boolean",
816
- value: isSupportedNativeBrowser,
817
- queryParam: true,
856
+ test: {
857
+ type: "object",
858
+ default(): Object {
859
+ return {
860
+ action: "checkout",
861
+ };
862
+ },
818
863
  },
819
864
 
820
865
  userExperienceFlow: {
@@ -823,59 +868,24 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
823
868
  value: getUserExperienceFlow,
824
869
  },
825
870
 
826
- applePay: {
827
- type: "function",
828
- required: false,
829
- value: applePaySession,
830
- },
831
-
832
- // allowBillingPayments prop is used by Honey Extension to render the one-click button
833
- // with payment methods & to use the payment methods instead of the Billing Agreement
834
- allowBillingPayments: {
835
- type: "boolean",
836
- queryParam: true,
837
- required: false,
838
- default: () => true,
839
- },
840
- createVaultSetupToken: {
841
- type: "function",
871
+ userIDToken: {
872
+ type: "string",
873
+ default: getUserIDToken,
842
874
  required: false,
875
+ queryParam: getEnv() !== ENV.LOCAL && getEnv() !== ENV.STAGE,
876
+ bodyParam: getEnv() === ENV.LOCAL || getEnv() === ENV.STAGE,
843
877
  },
844
878
 
845
- disableSetCookie: {
879
+ vault: {
846
880
  type: "boolean",
847
881
  queryParam: true,
848
- required: false,
849
- value: getDisableSetCookie,
882
+ value: getVault,
850
883
  },
851
884
 
852
- experimentation: {
885
+ wallet: {
853
886
  type: "object",
854
- queryParam: true,
855
- required: false,
856
- value: getExperimentation,
857
- },
858
-
859
- hostedButtonId: {
860
- type: "string",
861
- required: false,
862
- queryParam: true,
863
- },
864
-
865
- pageType: {
866
- type: "string",
867
- required: false,
868
- queryParam: true,
869
- value: () => getSDKAttribute(SDK_SETTINGS.PAGE_TYPE),
870
- },
871
-
872
- displayOnly: {
873
- type: "array",
874
- queryParam: true,
875
887
  required: false,
876
- value: ({ props }) => {
877
- return props?.displayOnly || [];
878
- },
888
+ default: () => window.__TEST_WALLET__,
879
889
  },
880
890
  },
881
891
  });