How to use the zoid/src.create function in zoid

To help you get started, we’ve selected a few zoid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / paypal-checkout-components / src / threeDomainSecure / index.js View on Github external
/* @flow */
/** @jsx jsxDom */
/* eslint max-lines: 0 */

import { create } from 'zoid/src';
import { base64encode } from 'belter/src';

import { ENV } from '../constants';
import { getBrowserLocale, getCurrentScriptUrl } from '../lib';
import { config } from '../config';
import { containerTemplate } from '../billing/template';

export const ThreeDomainSecure = create({
    tag:  'paypal-3ds',
    name: '3ds',

    buildUrl(props) : string {
        const env = props.env || config.env;
        return `${ config.inlinedCardFieldUrls[env] }/init3ds`;
    },

    get domain() : Object {
        return {
            ...config.paypalDomains
        };
    },

    scrolling: true,
github paypal / paypal-card-components / src / contingency-flow.js View on Github external
INVISIBLE:       'invisible',
  COMPONENT_FRAME: 'component-frame',
  PRERENDER_FRAME: 'prerender-frame'
};

type ContingencyProps = {|
  action : string,
  cart_id : string,
  flow : string,
  xcomponent : string,
  onContingencyResult : (err : mixed, result : Object) => void
|};

let contingencyResolveFunction;

const ContingencyComponent : ZoidComponent = create({
  url:      () => `${ getPayPalDomain() }/webapps/helios`,
  props:    {
    action: {
      type:       'string',
      queryParam: true
    },
    xcomponent: {
      type:       'string',
      queryParam: true
    },
    flow: {
      type:       'string',
      queryParam: true
    },
    cart_id: {
      type:       'string',
github paypal / paypal-checkout-components / src / billing / index.js View on Github external
import { containerTemplate } from './template';

type BillingOptions = {|
    client : {
        [string] : (string | ZalgoPromise)
    },
    env? : string,
    locale? : string,
    logLevel : string,
    awaitPopupBridge : Function,
    meta : Object,
    commit : boolean,
    token : string
|};

export const BillingPage : Component = create({
    tag:  'billing-page',
    name: 'billing-page',

    buildUrl(props) : string {
        const env = props.env || config.env;
        return `${ config.inlinedCardFieldUrls[env] }/billing`;
    },

    get domain() : Object {
        return {
            ...config.paypalDomains,
            [ ENV.LOCAL ]: /^http:\/\/localhost.paypal.com:\d+$/
        };
    },

    scrolling: true,
github paypal / paypal-checkout-components / src / zoid / checkout / component.jsx View on Github external
return inlineMemoize(getCheckoutComponent, () => {
        const component = create({

            tag:  'paypal-checkout',
        
            attributes: {
                iframe: {
                    scrolling: 'yes'
                }
            },
        
            defaultContext: supportsPopups() ? CONTEXT.POPUP : CONTEXT.IFRAME,
        
            url: getCheckoutUrl,
        
            domain: getPayPalDomainRegex(),
        
            logger: getLogger(),