
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@justeat/f-checkout
Advanced tools
Fozzie Checkout Component
Install the module using NPM or Yarn:
yarn add @justeat/f-checkout
npm install @justeat/f-checkout
Import the component and its module, ensuring the latter is registered in the Vuex store upon creation.
You can import it in your Vue SFC like this (please note that styles have to be imported separately):
import { VueCheckout, CheckoutModule } from '@justeat/f-checkout';
import '@justeat/f-checkout/dist/f-checkout.css';
export default {
components: {
VueCheckout
},
created () {
if (!this.$store.hasModule('checkout')) {
this.$store.registerModule('checkout', CheckoutModule);
}
},
}
If you are using Webpack, you can import the component dynamically to separate the vue-checkout
bundle from the main bundle.client.js
:
import '@justeat/f-checkout/dist/f-checkout.css';
export default {
components: {
...
VueCheckout: () => import(/* webpackChunkName: "vue-checkout" */ '@justeat/f-checkout')
}
}
f-checkout
has a number of props that allow you to customise its functionality.
The props that can be defined are as follows:
Prop | Type | Default | Description |
---|---|---|---|
checkoutId | String | This prop is required | Unique ID for the checkout. Currently this is the basket ID. |
checkoutUrl | String | - | URL for the API called to load the Checkout Data. The data returned from this API contains the serviceType, which determines if the Checkout component is created for Collection or Delivery when the user is authenticated. |
checkoutAvailableFulfilmentUrl | String | - | URL for the API called to load the Available Fulfilment data. |
createGuestUrl | String | - | URL for the API called to load the Create a Guest User. |
getBasketUrl | String | - | URL for the API called to get Basket Details. The data returned from this API contains the serviceType, which determines if the Checkout component is created for Collection or Delivery when the user is not authenticated. |
checkoutTimeout | Number | 1000 | Timeout when submitting the checkout form. |
getCheckoutTimeout | Number | 1000 | Timeout when loading checkout data. |
createGuestTimeout | Number | 1000 | Timeout when creating a guest user. |
getBasketTimeout | Number | 1000 | Timeout when loading basket data. |
authToken | String | '' | Authorisation token used when submitting the checkout form. |
loginUrl | String | - | URL to navigate to if the user wishes to change account. |
Event | Description |
---|---|
checkout-payment-success | Emitted when checkout form is successfully submitted. |
checkout-payment-failure | Emitted when checkout form fails when submitted. |
checkout-get-success | Emitted when checkout data is successfully loaded. |
checkout-get-failure | Emitted when checkout data fails to load. |
checkout-available-fulfilment-get-success | Emitted when available fulfilment times are successfully loaded. |
checkout-available-fulfilment-get-failure | Emitted when available fulfilment times fail to load. |
checkout-visit-login-page | Emitted when user clicks the Not you? link |
checkout-basket-get-success | Emitted when basket data is successfully loaded. |
checkout-basket-get-failure | Emitted when basket data fails to load. |
You can add event listeners for these like so
<template>
<vue-checkout
@checkoutPaymentSuccess="onPaymentSuccess"
@checkoutPaymentFailure="onPaymentFailure"
@checkoutGetSuccess="onGetCheckoutSuccess"
@checkoutGetFailure="onGetCheckoutFailure"
@checkoutGetPaymentSuccess="onGetPaymentSuccess"
@checkoutGetPaymentFailure="onGetPaymentFailure"
@checkoutGetBasketSuccess="onGetBasketSuccess"
@checkoutGetBasketFailure="onGetBasketFailure">
</vue-checkout>
</template>
<script>
export default {
methods: {
onPaymentSuccess () {
// Do stuff here
},
onPaymentFailure () {
// Do stuff here
},
onGetCheckoutSuccess () {
// Do stuff here
},
onGetCheckoutFailure () {
// Do stuff here
},
onGetPaymentSuccess () {
// Do stuff here
},
onGetPaymentFailure () {
// Do stuff here
},
onGetBasketSuccess () {
// Do stuff here
},
onGetBasketFailure () {
// Do stuff here
},
}
}
</script>
It is recommended to run the following commands at the root of the monorepo in order to install dependencies and allow you to view components in isolation via Storybook.
# cd ./fozzie-components
yarn install
## Testing
Unit / Integration / Contract
```bash
# Run Unit / Integration / Contract tests for all components
cd ./fozzie-components
yarn test
OR
# Run Unit / Integration / Contract tests for f-checkout
cd ./fozzie-components/packages/f-checkout
yarn test
Component Tests
# Run Component tests for all components
# Note: Ensure Storybook is not running when running the following commands
cd ./fozzie-components
yarn storybook:build
yarn storybook:serve-static
yarn test-component:chrome
OR
# Run Component tests for f-checkout
# Note: Ensure Storybook is not running when running the following commands
cd ./fozzie-components/packages/f-checkout
yarn test-component:chrome
FAQs
Fozzie Checkout - Fozzie Checkout Component
We found that @justeat/f-checkout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 29 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.