Copyright © 2017 W3C ® (MIT, ERCIM, Keio, Beihang)
En un click
const methodData = [ {
supportedMethods: "basic-card",
data: {
supportedNetworks: ["visa", "mastercard"],
supportedTypes: ["debit", "credit"]
}}];
const details = {
id: "super-store-order-123-12312",
displayItems: [{
label: "Sous-total",
amount: { currency: "EUR", value: "55.00" },
},{
label: "TVA",
amount: { currency: "EUR", value: "11.00" },
}],
total: {
label: "Total à payer",
// Le total est de 70€ puisqu'on ajoute 4€ de frais de livraison
amount: { currency: "EUR", value: "80.00" },
}
};
const shippingOptions = [
{
id: "standard",
label: "🚛 Transport terrestre (2 jours)",
amount: { currency: "EUR", value: "4.00" },
selected: true,
},
{
id: "drone",
label: "🚀 Drone Express (2 heures)",
amount: { currency: "EUR", value: "25.00" }
},
];
Object.assign(details, { shippingOptions });
const request = new PaymentRequest(methodData, details, options);
const response = await request.show();
await valideReponse(response);
Disponible
En développement
Plate-forme Shopify, Woo, Mobify, Weeebly, Womp, (Magento), Facebook Messenger …
Marchands Washington Post, NY Times, Groupon, JD, Wego, Nivea, Monzo, (AirBnB) …
caniuse