Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
generic-component
Advanced tools
<script type="module" src="/build/adyen-checkout.esm.js"></script>
<script nomodule src="/build/adyen-checkout.js"></script>
<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)
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
andcomponent
) in theevent.detail
createFromAction
method. You can call it this way:
const checkoutComponent = document.querySelector('adyen-checkout');
checkoutComponent.createFromAction(response.action, response.resultCode);
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);
chmod +x ./install.sh
and then ./install.sh
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 acceptsvalue
,currency
,countryCode
andlocale
as query parameters. i.e.:http://localhost:3024/?value=1000¤cy=EUR&countryCode=NL&locale=nl_NL
If you need to add more payment methods, you can edit the
./src/index.html
FAQs
Stencil Component Starter
The npm package generic-component receives a total of 0 weekly downloads. As such, generic-component popularity was classified as not popular.
We found that generic-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.