@paypal/checkout-components
Advanced tools
Comparing version 5.0.323 to 5.0.324-alpha-2739cc0.0
{ | ||
"name": "@paypal/checkout-components", | ||
"version": "5.0.323", | ||
"version": "5.0.324-alpha-2739cc0.0", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,7 +17,2 @@ /* @flow */ | ||
import { BUTTON_LAYOUT, BUTTON_FLOW } from "../constants"; | ||
import type { | ||
OnShippingChange, | ||
OnShippingAddressChange, | ||
OnShippingOptionsChange, | ||
} from "../ui/buttons/props"; | ||
@@ -270,10 +265,6 @@ import { getFundingConfig } from "./config"; | ||
wallet, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}: {| | ||
wallet: ?Wallet, | ||
onShippingChange: ?OnShippingChange, | ||
onShippingAddressChange: ?OnShippingAddressChange, | ||
onShippingOptionsChange: ?OnShippingOptionsChange, | ||
hasShippingCallback: boolean, | ||
|}): boolean { | ||
@@ -284,3 +275,3 @@ if (!wallet) { | ||
if (onShippingChange || onShippingAddressChange || onShippingOptionsChange) { | ||
if (hasShippingCallback) { | ||
return false; | ||
@@ -287,0 +278,0 @@ } |
@@ -7,3 +7,3 @@ /* @flow */ | ||
import { isFundingEligible } from "./funding"; | ||
import { isFundingEligible, isWalletFundingEligible } from "./funding"; | ||
@@ -142,1 +142,35 @@ const defaultMockFundingOptions = { | ||
}); | ||
describe("isWalletFundingEligible", () => { | ||
const mockWalletValue = { instruments: [] }; | ||
const mockWallet = { | ||
paypal: mockWalletValue, | ||
card: mockWalletValue, | ||
credit: mockWalletValue, | ||
venmo: mockWalletValue, | ||
}; | ||
test("should not be eligible if a shipping callback is present", () => { | ||
const result = isWalletFundingEligible({ | ||
wallet: mockWallet, | ||
hasShippingCallback: true, | ||
}); | ||
expect(result).toBe(false); | ||
}); | ||
test("should not be eligible if wallet does not exist", () => { | ||
const result = isWalletFundingEligible({ | ||
wallet: null, | ||
hasShippingCallback: false, | ||
}); | ||
expect(result).toBe(false); | ||
}); | ||
test("should be eligible if a shipping callback is not present & wallet exists", () => { | ||
const result = isWalletFundingEligible({ | ||
wallet: mockWallet, | ||
hasShippingCallback: false, | ||
}); | ||
expect(result).toBe(true); | ||
}); | ||
}); |
@@ -26,9 +26,3 @@ /* @flow */ | ||
import { | ||
normalizeButtonProps, | ||
type ButtonPropsInputs, | ||
type OnShippingChange, | ||
type OnShippingAddressChange, | ||
type OnShippingOptionsChange, | ||
} from "./props"; | ||
import { normalizeButtonProps, type ButtonPropsInputs } from "./props"; | ||
import { Style } from "./style"; | ||
@@ -45,5 +39,3 @@ import { Button } from "./button"; | ||
fundingSource: $Values<typeof FUNDING>, | ||
onShippingChange: ?OnShippingChange, | ||
onShippingAddressChange: ?OnShippingAddressChange, | ||
onShippingOptionsChange: ?OnShippingOptionsChange, | ||
hasShippingCallback: boolean, | ||
|}; | ||
@@ -54,5 +46,3 @@ | ||
fundingSource, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}: GetWalletInstrumentOptions): ?WalletInstrument { | ||
@@ -62,5 +52,3 @@ if ( | ||
wallet, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}) | ||
@@ -88,5 +76,3 @@ ) { | ||
fundingSources: $ReadOnlyArray<$Values<typeof FUNDING>>, | ||
onShippingChange: ?OnShippingChange, | ||
onShippingAddressChange: ?OnShippingAddressChange, | ||
onShippingOptionsChange: ?OnShippingOptionsChange, | ||
hasShippingCallback: boolean, | ||
layout: $Values<typeof BUTTON_LAYOUT>, | ||
@@ -99,5 +85,3 @@ |}; | ||
fundingSources, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}: GetWalletInstrumentsOptions): {| | ||
@@ -111,5 +95,3 @@ [$Values<typeof FUNDING>]: WalletInstrument, | ||
fundingSource: source, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}); | ||
@@ -244,5 +226,3 @@ | ||
layout, | ||
onShippingChange, | ||
onShippingAddressChange, | ||
onShippingOptionsChange, | ||
hasShippingCallback, | ||
}); | ||
@@ -249,0 +229,0 @@ |
@@ -126,3 +126,5 @@ /* @flow */ | ||
required: false, | ||
queryParam: false, | ||
queryParam: ({ value }) => | ||
value?.searchParameter || "atomicsWaitingState", | ||
queryValue: ({ value }) => value?.encodedState || "", | ||
}, | ||
@@ -129,0 +131,0 @@ clientID: { |
@@ -42,2 +42,6 @@ /* @flow */ | ||
|}, | ||
atomicsWaitingState: {| | ||
searchParameter: string, | ||
encodedState: string, | ||
|}, | ||
|}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16307
1195871
1