Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const methodData = [
  2.   {
  3.     supportedMethods: "basic-card",
  4.     data: {
  5.       supportedNetworks: ["visa", "mastercard"],
  6.       supportedTypes: ["debit"],
  7.     },
  8.   },
  9.   {
  10.     supportedMethods: "https://example.com/bobpay",
  11.     data: {
  12.       merchantIdentifier: "XXXX",
  13.       bobPaySpecificField: true,
  14.     },
  15.   },
  16. ];
  17. const details = {
  18.   id: "super-store-order-123-12312",
  19.   displayItems: [
  20.     {
  21.       label: "Sub-total",
  22.       amount: { currency: "USD", value: "55.00" },
  23.     },
  24.     {
  25.       label: "Sales Tax",
  26.       amount: { currency: "USD", value: "5.00" },
  27.       type: "tax"
  28.     },
  29.   ],
  30.   total: {
  31.     label: "Total due",
  32.     // The total is USD$65.00 here because we need to
  33.     // add shipping (below). The selected shipping
  34.     // costs USD$5.00.
  35.     amount: { currency: "USD", value: "65.00" },
  36.   },
  37. };
  38.  
  39. // Credit card incurs a $3.00 processing fee.
  40. const creditCardFee = {
  41.   label: "Credit card processing fee",
  42.   amount: { currency: "USD", value: "3.00" },
  43. };
  44.  
  45. // Modifiers apply when the user chooses to pay with
  46. // a credit card.
  47. const modifiers = [
  48.   {
  49.     additionalDisplayItems: [creditCardFee],
  50.     supportedMethods: "basic-card",
  51.     total: {
  52.       label: "Total due",
  53.       amount: { currency: "USD", value: "68.00" },
  54.     },
  55.     data: {
  56.       supportedTypes: "credit",
  57.     },
  58.   },
  59. ];
  60. Object.assign(details, { modifiers });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement