@paypal/checkout-components 5.0.236 → 5.0.237

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.236",
3
+ "version": "5.0.237",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -94,7 +94,7 @@
94
94
  "@paypal/common-components": "^1.0.27",
95
95
  "@paypal/funding-components": "^1.0.27",
96
96
  "@paypal/sdk-client": "^4.0.166",
97
- "@paypal/sdk-constants": "^1.0.119",
97
+ "@paypal/sdk-constants": "^1.0.123",
98
98
  "@paypal/sdk-logos": "^1.0.45"
99
99
  },
100
100
  "lint-staged": {
@@ -8,6 +8,7 @@ import { allowIframe as _allowIframe } from '../lib';
8
8
  import { getCheckoutComponent, type CheckoutComponent } from '../zoid/checkout';
9
9
  import { getButtonsComponent, type ButtonsComponent } from '../zoid/buttons';
10
10
  import { getCardFormComponent, type CardFormComponent } from '../zoid/card-form';
11
+ import { getPaymentFieldsComponent, type PaymentFieldsComponent } from '../zoid/payment-fields';
11
12
  import { getMenuComponent, type MenuComponent } from '../zoid/menu';
12
13
  import { getInstallmentsComponent, type InstallmentsComponent } from '../zoid/installments';
13
14
  import { Buttons as _ButtonsTemplate } from '../ui/buttons';
@@ -32,6 +33,10 @@ export const CardForm : LazyProtectedExport<CardFormComponent> = {
32
33
  __get__: () => protectedExport(getCardFormComponent())
33
34
  };
34
35
 
36
+ export const PaymentFields : LazyProtectedExport<PaymentFieldsComponent> = {
37
+ __get__: () => protectedExport(getPaymentFieldsComponent())
38
+ };
39
+
35
40
  export const Menu : LazyProtectedExport<MenuComponent> = {
36
41
  __get__: () => protectedExport(getMenuComponent())
37
42
  };
@@ -2,7 +2,7 @@
2
2
  /** @jsx node */
3
3
 
4
4
  import { node, type ElementNode } from '@krakenjs/jsx-pragmatic/src';
5
- import { FUNDING, WALLET_INSTRUMENT } from '@paypal/sdk-constants/src';
5
+ import { FUNDING, WALLET_INSTRUMENT, APM_LIST } from '@paypal/sdk-constants/src';
6
6
  import { noop } from '@krakenjs/belter/src';
7
7
 
8
8
  import type { Wallet, WalletInstrument } from '../../types';
@@ -124,6 +124,10 @@ export function Buttons(props : ButtonsProps) : ElementNode {
124
124
  }
125
125
  }
126
126
 
127
+ const isAPM = fundingSources.some(src => {
128
+ return APM_LIST.includes(src);
129
+ });
130
+
127
131
  const instruments = getWalletInstruments({ wallet, fundingSources, layout, onShippingChange, onShippingAddressChange, onShippingOptionsChange });
128
132
 
129
133
  const isWallet = (
@@ -210,6 +214,12 @@ export function Buttons(props : ButtonsProps) : ElementNode {
210
214
  : null
211
215
  }
212
216
 
217
+ {
218
+ (isAPM)
219
+ ? <div id="payment-fields-container" className="payment-fields-container"/>
220
+ : null
221
+ }
222
+
213
223
  {
214
224
  (layout === BUTTON_LAYOUT.VERTICAL && fundingSources.indexOf(FUNDING.CARD) !== -1 && !inlineExperience)
215
225
  ? <PoweredByPayPal
@@ -122,6 +122,32 @@ export function getPaymentFieldsComponent() : PaymentFieldsComponent {
122
122
  required: false
123
123
  },
124
124
 
125
+ onError: {
126
+ type: 'function',
127
+ required: false
128
+ },
129
+
130
+ onContinue: {
131
+ type: 'function',
132
+ required: false
133
+ },
134
+
135
+ onClose: {
136
+ type: 'function',
137
+ required: false
138
+ },
139
+
140
+ showActionButtons: {
141
+ type: 'boolean',
142
+ queryParam: true,
143
+ required: false
144
+ },
145
+
146
+ onFieldsClose: {
147
+ type: 'function',
148
+ required: false
149
+ },
150
+
125
151
  buyerCountry: {
126
152
  type: 'string',
127
153
  queryParam: true,