mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +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 merge from "deepmerge";
|
||||||
import {keysToCamelCase} from "./Utils";
|
import {keysToCamelCase} from "./Utils";
|
||||||
import {getCurrentPaymentMethod} from "./CheckoutMethodState";
|
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.
|
// This component may be used by multiple modules. This assures that options are shared between all instances.
|
||||||
let options = window.ppcpWidgetBuilder = window.ppcpWidgetBuilder || {
|
let options = window.ppcpWidgetBuilder = window.ppcpWidgetBuilder || {
|
||||||
|
@ -63,7 +64,7 @@ export const loadPaypalScript = (config, onLoaded, onError = null) => {
|
||||||
|
|
||||||
// Axo SDK options
|
// Axo SDK options
|
||||||
const sdkClientToken = config?.axo?.sdk_client_token;
|
const sdkClientToken = config?.axo?.sdk_client_token;
|
||||||
const uuid = self.crypto.randomUUID();
|
const uuid = uuidv4().replace(/-/g, '');
|
||||||
if(sdkClientToken) {
|
if(sdkClientToken) {
|
||||||
scriptOptions['data-sdk-client-token'] = sdkClientToken;
|
scriptOptions['data-sdk-client-token'] = sdkClientToken;
|
||||||
scriptOptions['data-client-metadata-id'] = uuid;
|
scriptOptions['data-client-metadata-id'] = uuid;
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"playwright": "^1.43.0",
|
"playwright": "^1.43.0",
|
||||||
"run-s": "^0.0.0"
|
"run-s": "^0.0.0",
|
||||||
|
"uuid": "^9.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue