Skip to content

Commit

Permalink
fix(venmo): web config (#2189)
Browse files Browse the repository at this point in the history
* fix(venmo): web config

* fix(venmo): regex

* chore(build): dist

* fix(review): device

Co-authored-by: Greg Jopa <[email protected]>

---------

Co-authored-by: Steve Mask <[email protected]>
Co-authored-by: Greg Jopa <[email protected]>
  • Loading branch information
3 people committed Jun 15, 2023
1 parent d9acf38 commit d7fca3e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/button.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/test/button.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/test/button.js.LICENSE.txt
@@ -0,0 +1 @@
/*! Isomorphic Style Loader | MIT License | https://github.com/kriasoft/isomorphic-style-loader */
30 changes: 30 additions & 0 deletions src/zoid/venmo/component.jsx
Expand Up @@ -35,6 +35,11 @@ import type { CheckoutPropsType } from "../checkout/props";

import { DEFAULT_POPUP_SIZE, HISTORY_NATIVE_POPUP_DOMAIN } from "./config";

const CHANNEL = {
DESKTOP: "desktop-web",
MOBILE: "mobile-web",
};

export type VenmoCheckoutComponent = ZoidComponent<CheckoutPropsType>;

export function getVenmoCheckoutComponent(): VenmoCheckoutComponent {
Expand Down Expand Up @@ -161,6 +166,19 @@ export function getVenmoCheckoutComponent(): VenmoCheckoutComponent {
value: getLocale,
},

channel: {
type: "string",
queryParam: true,
required: false,
value: () => (isDevice() ? CHANNEL.MOBILE : CHANNEL.DESKTOP),
},

parentDomain: {
type: "string",
queryParam: true,
required: true,
},

createOrder: {
type: "function",
queryParam: "token",
Expand Down Expand Up @@ -272,6 +290,18 @@ export function getVenmoCheckoutComponent(): VenmoCheckoutComponent {
return (handler) => event.on(EVENT.FOCUS, handler);
},
},

venmoWebUrl: {
type: "string",
queryParam: true,
required: true,
},

venmoWebEnabled: {
type: "boolean",
queryParam: true,
required: false,
},
},

dimensions: ({ props }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/zoid/venmo/config.js
Expand Up @@ -12,8 +12,8 @@ export const DEFAULT_POPUP_SIZE = {
};

export const HISTORY_NATIVE_POPUP_DOMAIN: EnvConfig = {
[ENV.TEST]: "https://history.paypal.com",
[ENV.LOCAL]: "http://localhost:8001",
[ENV.TEST]: "https://localhost.paypal.com:8443",
[ENV.LOCAL]: "https://localhost.paypal.com:8443",
[ENV.STAGE]: "https://history.paypal.com",
[ENV.SANDBOX]: "https://history.paypal.com",
[ENV.PRODUCTION]: "https://history.paypal.com",
Expand Down
12 changes: 11 additions & 1 deletion webpack.config.js
Expand Up @@ -33,4 +33,14 @@ export const WEBPACK_CONFIG_BUTTON_RENDER: WebpackConfig = getWebpackConfig({
vars: globals,
});

export default [WEBPACK_CONFIG_BUTTON_RENDER];
export const WEBPACK_CONFIG_TEST_BUTTON_RENDER: WebpackConfig = getWebpackConfig({
context: __dirname,
entry: "./src/ui/buttons",
filename: "./test/button.js",
modulename: MODULE_NAME,
web: false,
libraryTarget: "commonjs2",
vars: { ...getTestGlobals(globals) },
});

export default [WEBPACK_CONFIG_BUTTON_RENDER, WEBPACK_CONFIG_TEST_BUTTON_RENDER];

0 comments on commit d7fca3e

Please sign in to comment.