npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generic-component

v0.1.2

Published

Stencil Component Starter

Downloads

1,193

Readme

Getting Started

Installation

  1. Download the latest build zip file from the releases and extract the content.
  2. Add script tags to your HTML and point them to the extracted files:
    <script type="module" src="/build/adyen-checkout.esm.js"></script>
    <script nomodule src="/build/adyen-checkout.js"></script>
  3. Add checkout web-component to your HTML. Example:
    <adyen-checkout
      locale=""
      country-code=""
      environment=""
      origin-key=""
      payment-methods=""
      amount=""
      payment-methods-configuration=""
    >
        <adyen-payment-method-card></adyen-payment-method-card>
        <adyen-payment-method-bcmc></adyen-payment-method-bcmc>
        <adyen-payment-method-local></adyen-payment-method-local>
        <adyen-payment-method-swish></adyen-payment-method-swish>
    </adyen-checkout>

    Component documentation, including instructions, attributes, events and required properties can be found on it's folder (i.e. src/components/checkout)

  4. Listening to events (i.e. onSubmit, onChange and etc...) can be done like this:
     const checkoutComponent = document.querySelector('adyen-checkout');
     const logEvent = (ev) => console.log(ev);
     checkoutComponent.addEventListener('adyenChange', logEvent);
     checkoutComponent.addEventListener('adyenBrand', logEvent);
     checkoutComponent.addEventListener('adyenAdditionalDetails', logEvent);
     checkoutComponent.addEventListener('adyenSubmit', logEvent);

    Note that all events will be prefixed with Adyen and the on word is removed. You can find checkout data (i.e state and component) in the event.detail

  5. If your payment response includes an action, the checkout component includes a createFromAction method. You can call it this way:
    const checkoutComponent = document.querySelector('adyen-checkout');
    checkoutComponent.createFromAction(response.action, response.resultCode); 

Additional Information

If you need data to be available on your JavaScript before rendering your web-component, you can insert the web-component in your page using JavaScript and dynamically pass the values. Like this:

const node = `
   <adyen-checkout
     locale=${locale}
     country-code=${countryCode}
     environment=${environment}
     origin-key=${originKey}
     payment-methods='${paymentMethods}'
     amount='${JSON.stringify(amount)}'
     payment-methods-configuration='${paymentMethodsConfiguration}'
   >
       <adyen-payment-method-card enable-combo-cards installments='${installments}' show-pay-button></adyen-payment-method-card>
       <adyen-payment-method-bcmc show-pay-button></adyen-payment-method-bcmc>
       <adyen-payment-method-local></adyen-payment-method-local>
       <adyen-payment-method-swish></adyen-payment-method-swish>
   </adyen-checkout>
`;

document.body.insertAdjacentHTML("beforeend", node);

Running local demo

  1. Run chmod +x ./install.sh and then ./install.sh
  2. Run vagrant ssh -c "cd workspace && yarn run server"

You can access the demo by visiting the url http://localhost:3024/ on your browser. The url accepts value, currency, countryCode and locale as query parameters. i.e.: http://localhost:3024/?value=1000&currency=EUR&countryCode=NL&locale=nl_NL

If you need to add more payment methods, you can edit the ./src/index.html