diff --git a/src/funding/venmo/config.jsx b/src/funding/venmo/config.jsx index 015ca4a694..214faef41b 100644 --- a/src/funding/venmo/config.jsx +++ b/src/funding/venmo/config.jsx @@ -23,19 +23,20 @@ export function getVenmoConfig(): FundingSourceConfig { eligible: ({ experiment, shippingChange, displayOnly, flow }) => { /** - * This could probably be removed if the enableVenmo experiment is - * rolled out to 100%. + * enableVenmo checks native browser compatibility and ramp + * ignore above compatibility if forcing to web */ - if (experiment && experiment.enableVenmo === false) { + if ( + experiment && + experiment.enableVenmo === false && + experiment.venmoWebEnabled !== true && + experiment.venmoEnableWebOnNonNativeBrowser !== true + ) { return false; } /** * Shipping callbacks will not work with Venmo unless venmo web is enabled. - * - * Note that this could cause the Venmo button to not show up on first render - * if a merchant passes a shipping callback but does not have a client ID - * that has Venmo Web enabled. */ if (!experiment?.venmoWebEnabled && shippingChange) { return false; @@ -62,7 +63,8 @@ export function getVenmoConfig(): FundingSourceConfig { if ( platform === PLATFORM.MOBILE && experiment && - experiment.venmoWebEnabled === false + experiment.venmoWebEnabled !== true && + experiment.venmoEnableWebOnNonNativeBrowser !== true ) { return { native: true, diff --git a/src/funding/venmo/config.test.js b/src/funding/venmo/config.test.js index b659d2045b..4263a5b5f8 100644 --- a/src/funding/venmo/config.test.js +++ b/src/funding/venmo/config.test.js @@ -13,6 +13,7 @@ describe("Venmo eligibility", () => { fundingEligibility: {}, experiment: { venmoWebEnabled: true, + venmoEnableWebOnNonNativeBrowser: true, }, wallet: expect.any, flow: BUTTON_FLOW.PURCHASE, @@ -74,7 +75,7 @@ describe("Venmo eligibility", () => { expect(isVenmoEligible).toEqual(true); }); - test("should not be eligible if a shipping callback is passed & experiment does not include venmoWebEnabled", () => { + test("should not be eligible if a shipping callback is passed & experiment does not include venmoWebEnabled or venmoEnableWebOnNonNativeBrowser", () => { const isVenmoEligible = venmoConfig.eligible?.({ ...baseEligibilityProps, experiment: {}, @@ -84,7 +85,7 @@ describe("Venmo eligibility", () => { expect(isVenmoEligible).toEqual(false); }); - test("should be eligible if shipping callback exists & experiment includes venmoWebEnabled", () => { + test("should be eligible if shipping callback exists & experiment includes venmoWebEnabled or venmoEnableWebOnNonNativeBrowser", () => { const isVenmoEligible = venmoConfig.eligible?.({ ...baseEligibilityProps, shippingChange: true, diff --git a/src/types.js b/src/types.js index 6a629cdebe..3c1d55ee3b 100644 --- a/src/types.js +++ b/src/types.js @@ -62,6 +62,7 @@ export type Experiment = {| venmoWebEnabled?: boolean, // first render experiments venmoVaultWithoutPurchase?: boolean, + venmoEnableWebOnNonNativeBrowser?: boolean, |}; export type Requires = {| diff --git a/src/zoid/venmo/component.jsx b/src/zoid/venmo/component.jsx index a1b036d291..b00c47ee2f 100644 --- a/src/zoid/venmo/component.jsx +++ b/src/zoid/venmo/component.jsx @@ -296,6 +296,12 @@ export function getVenmoCheckoutComponent(): VenmoCheckoutComponent { required: false, }, + venmoEnableWebOnNonNativeBrowser: { + type: "boolean", + queryParam: true, + required: false, + }, + venmoVaultEnabled: { type: "boolean", queryParam: true,