Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@myparcel/checkout
Advanced tools
[![Build Status](https://travis-ci.com/myparcelbe/checkout.svg?branch=master)](https://travis-ci.com/myparcelbe/checkout) [![Coverage Status](https://coveralls.io/repos/github/myparcelbe/checkout/badge.svg?branch=master)](https://coveralls.io/github/mypar
This is the MyParcel checkout module. It's used to show your customers the possible delivery and/or pickup options for their location, based on your settings. It barely has any css styling by itself so it should integrate with the design of your website easily.
The checkout is written in Vue.js, it supports IE9 and up.
An example of the checkout functionality can be found in our sandbox. Here you can try out every combination of settings and copy the code for your project.
$ npm i
$ npm run build
dist/myparcel.js
in your project.<div id="myparcel-checkout"></div>
in your HTML.You have to provide a configuration file in the following format as window.MyParcelConfig
and initialize the checkout with an event.
This is the minimum amount of data you need to provide for the checkout to work correctly as a SendMyParcel user.
window.MyParcelConfig = {
config: {
platform: 'belgie',
},
address: {
cc: 'BE',
city: 'Antwerpen',
postalCode: '1000',
}
};
// Trigger this event on the document to tell the checkout to update.
// Usually only needed on initializing and when the address changes.
document.dispatchEvent(new Event('myparcel_update_checkout'));
window.MyParcelConfig = {
config: {
platform: 'belgie',
carriers: ['bpost', 'dpd'],
// All settings below can be overridden per carrier via the carrierSettings object
// The price for each option
priceMorningDelivery: 7.95,
priceStandardDelivery: 5.85,
priceEveningDelivery: 6.25,
priceSignature: 0.35,
priceOnlyRecipient: 0.30,
pricePickup: 5.85,
// Additional delivery options
allowSaturdayDelivery: true,
allowPickupLocations: true,
allowSignature: true,
// Other settings
dropOffDays: '1;2;3;4;5;6',
cutoffTime: '15:00',
deliveryDaysWindow: 4,
dropOffDelay: 1,
// Use this object to override settings per carrier.
carrierSettings: {
bpost: {
deliveryDaysWindow: 7,
},
dpd: {},
},
},
strings: {
wrongPostalCodeCity: 'Zaterdaglevering',
saturdayDeliveryTitle: 'Combinatie postcode/plaats onbekend',
// Address strings
city: 'Plaats',
postcode: 'Postcode',
houseNumber: 'Huisnummer',
addressNotFound: 'Adresgegevens niet ingevuld',
// Delivery moment titles.
// If any of these is not set, the delivery time will be visible instead.
deliveryEveningTitle: 'Avondlevering',
deliveryMorningTitle: 'Ochtendlevering',
deliveryStandardTitle: 'Standaardlevering',
deliveryTitle: 'Bezorgen op',
pickupTitle: 'Afhalen op locatie',
// Additional options
onlyRecipientTitle: 'Home address only',
signatureTitle: 'Handtekening',
pickUpFrom: 'Afhalen vanaf',
openingHours: 'Openingstijden',
// Other strings
closed: 'Gesloten',
discount: 'korting',
free: 'Gratis',
from: 'Vanaf',
loadMore: 'Laad meer',
retry: 'Opnieuw',
},
address: {
cc: 'BE',
city: 'Antwerpen',
postalCode: '1000',
}
};
When there is no title set for deliveryMorningTitle
, deliveryStandardTitle
or deliveryEveningTitle
, the delivery time will automatically be visible. For more in-depth explanation of each config item and string and an interactive demo please see our sandbox
To get the object with the selected options from the checkout do the following:
const data = document.querySelector('#mypa-input').value;
const obj = JSON.parse(data);
// `obj` will be something like this:
// {
// "delivery": "deliver",
// "deliveryDate": "8-8-2019",
// "deliveryMoment": "standard",
// "additionalOptions": []
// }
npm install
npm run serve
If you're experiencing trouble with the implementation we're ready to help you out! Please reach out to us via support@sendmyparcel.be
FAQs
MyParcel delivery options module for checkouts.
The npm package @myparcel/checkout receives a total of 2 weekly downloads. As such, @myparcel/checkout popularity was classified as not popular.
We found that @myparcel/checkout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.