mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Replace crypto.randomUUID with a dependency (3165)
This commit is contained in:
parent
9a17964967
commit
a3c610bc1c
2 changed files with 4 additions and 2 deletions
|
@ -4,6 +4,7 @@ import widgetBuilder from "../Renderer/WidgetBuilder";
|
|||
import merge from "deepmerge";
|
||||
import {keysToCamelCase} from "./Utils";
|
||||
import {getCurrentPaymentMethod} from "./CheckoutMethodState";
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
// This component may be used by multiple modules. This assures that options are shared between all instances.
|
||||
let options = window.ppcpWidgetBuilder = window.ppcpWidgetBuilder || {
|
||||
|
@ -63,7 +64,7 @@ export const loadPaypalScript = (config, onLoaded, onError = null) => {
|
|||
|
||||
// Axo SDK options
|
||||
const sdkClientToken = config?.axo?.sdk_client_token;
|
||||
const uuid = self.crypto.randomUUID();
|
||||
const uuid = uuidv4().replace(/-/g, '');
|
||||
if(sdkClientToken) {
|
||||
scriptOptions['data-sdk-client-token'] = sdkClientToken;
|
||||
scriptOptions['data-client-metadata-id'] = uuid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue