Skip to content

Commit

Permalink
(fix) loadV4 loader loads latest checkout.js
Browse files Browse the repository at this point in the history
  • Loading branch information
imbrian committed May 30, 2024
1 parent 48718ca commit d29f319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/meta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function unpackSDKMeta(sdkMeta?: string): SDKMeta {
return;
}
if (version === '4' || version === 'latest') {
if (version === 'latest' || version.charAt(0) === '4') {
version = '';
}
Expand Down
4 changes: 2 additions & 2 deletions server/meta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ test("should construct a valid versioned script url with paypalobjects", () => {
});

test("should construct a valid versioned minified script url with paypalobjects", () => {
const sdkUrl = "https://www.paypalobjects.com/api/checkout.4.0.125.min.js";
const sdkUrl = "https://www.paypalobjects.com/api/checkout.min.js";

const { getSDKLoader } = unpackSDKMeta(
Buffer.from(
Expand Down Expand Up @@ -809,7 +809,7 @@ test("should construct a valid minified loader even when no url passed", () => {
});

test("should construct a valid version loader even when no url passed", () => {
const sdkUrl = "https://www.paypalobjects.com/api/checkout.4.0.435.js";
const sdkUrl = "https://www.paypalobjects.com/api/checkout.js";

const { getSDKLoader } = unpackSDKMeta();

Expand Down

0 comments on commit d29f319

Please sign in to comment.