Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const methodData = [
- {
- supportedMethods: "basic-card",
- data: {
- supportedNetworks: ["visa", "mastercard"],
- supportedTypes: ["debit"],
- },
- },
- {
- supportedMethods: "https://example.com/bobpay",
- data: {
- merchantIdentifier: "XXXX",
- bobPaySpecificField: true,
- },
- },
- ];
- const details = {
- id: "super-store-order-123-12312",
- displayItems: [
- {
- label: "Sub-total",
- amount: { currency: "USD", value: "55.00" },
- },
- {
- label: "Sales Tax",
- amount: { currency: "USD", value: "5.00" },
- type: "tax"
- },
- ],
- total: {
- label: "Total due",
- // The total is USD$65.00 here because we need to
- // add shipping (below). The selected shipping
- // costs USD$5.00.
- amount: { currency: "USD", value: "65.00" },
- },
- };
- // Credit card incurs a $3.00 processing fee.
- const creditCardFee = {
- label: "Credit card processing fee",
- amount: { currency: "USD", value: "3.00" },
- };
- // Modifiers apply when the user chooses to pay with
- // a credit card.
- const modifiers = [
- {
- additionalDisplayItems: [creditCardFee],
- supportedMethods: "basic-card",
- total: {
- label: "Total due",
- amount: { currency: "USD", value: "68.00" },
- },
- data: {
- supportedTypes: "credit",
- },
- },
- ];
- Object.assign(details, { modifiers });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement