@paypal/checkout-components 5.0.233 → 5.0.235
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
|
@@ -124,7 +124,13 @@ export function getCardConfig() : FundingSourceConfig {
|
|
|
124
124
|
Label: ({ logo, locale, content, custom }) => {
|
|
125
125
|
if (custom && custom.label && custom.label.length) {
|
|
126
126
|
const validLabels = {
|
|
127
|
-
|
|
127
|
+
buy: 'Buy',
|
|
128
|
+
checkout: 'Checkout',
|
|
129
|
+
pay: 'Pay',
|
|
130
|
+
'buy now': 'Buy Now',
|
|
131
|
+
'pay now': 'Pay Now',
|
|
132
|
+
'checkout now': 'Checkout Now',
|
|
133
|
+
'proceed to checkout': 'Proceed to checkout'
|
|
128
134
|
};
|
|
129
135
|
|
|
130
136
|
let label = validLabels.checkout;
|
package/src/ui/buttons/props.js
CHANGED
|
@@ -351,7 +351,6 @@ export type ApplePayPaymentAuthorizationResult = {|
|
|
|
351
351
|
export type ApplePaySessionConfig = {|
|
|
352
352
|
begin : () => void,
|
|
353
353
|
abort : () => void,
|
|
354
|
-
oncancel : () => void,
|
|
355
354
|
addEventListener : (string, Function) => void,
|
|
356
355
|
// eslint-disable-next-line flowtype/no-weak-types
|
|
357
356
|
completeMerchantValidation : (validatedSession : any) => void,
|
package/src/zoid/buttons/util.js
CHANGED
|
@@ -192,6 +192,11 @@ export function applePaySession() : ?ApplePaySessionConfigRequest {
|
|
|
192
192
|
listeners.paymentauthorized({ payment });
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
+
// eslint-disable-next-line unicorn/prefer-add-event-listener
|
|
196
|
+
session.oncancel = () => {
|
|
197
|
+
listeners.oncancel();
|
|
198
|
+
};
|
|
199
|
+
|
|
195
200
|
return {
|
|
196
201
|
addEventListener: (name, handler) => {
|
|
197
202
|
listeners[name] = handler;
|
|
@@ -214,8 +219,7 @@ export function applePaySession() : ?ApplePaySessionConfigRequest {
|
|
|
214
219
|
session.completePayment(newUpdate);
|
|
215
220
|
},
|
|
216
221
|
begin: () => session.begin(),
|
|
217
|
-
abort: () => session.abort()
|
|
218
|
-
oncancel: () => session.oncancel()
|
|
222
|
+
abort: () => session.abort()
|
|
219
223
|
};
|
|
220
224
|
};
|
|
221
225
|
} catch (e) {
|
|
@@ -7,7 +7,7 @@ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
|
|
|
7
7
|
import { create, type ZoidComponent } from '@krakenjs/zoid/src';
|
|
8
8
|
import type { CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
|
|
9
9
|
import { inlineMemoize } from '@krakenjs/belter/src';
|
|
10
|
-
import { getLocale, getEnv, getCommit, getSDKMeta, getDisableCard, getPayPalDomain } from '@paypal/sdk-client/src';
|
|
10
|
+
import { getLocale, getEnv, getCommit, getSDKMeta, getDisableCard, getPayPalDomain, getClientMetadataID } from '@paypal/sdk-client/src';
|
|
11
11
|
|
|
12
12
|
import { getSessionID } from '../../lib';
|
|
13
13
|
|
|
@@ -74,6 +74,13 @@ export function getCardFormComponent() : CardFormComponent {
|
|
|
74
74
|
queryParam: true
|
|
75
75
|
},
|
|
76
76
|
|
|
77
|
+
clientMetadataID: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
required: false,
|
|
80
|
+
default: getClientMetadataID,
|
|
81
|
+
queryParam: 'client-metadata-id',
|
|
82
|
+
},
|
|
83
|
+
|
|
77
84
|
commit: {
|
|
78
85
|
type: 'boolean',
|
|
79
86
|
queryParam: true,
|