Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleSubmit Level III data using PayFields.

Step 1: Complete Steps 1-3 above.

Step 2: Under your <script> tag containing PayFields.fields add the following to include Discount, Shipping, Duty, and Item [details] Objects fields in your PayField:

Code Block
languagehtml
<script>
  PayFields.fields = [
    {type: "dicountdiscount", element: "#dicount#discount"},
    {type: "shipping", element: "#shipping"},
    {type: "duty", element: "#duty"},
    {type: "items", element: "#items"}    
  ];
</script>

Step 3: Under your <script> tag containing PayFields.config add the following:

Code Block
<script>
  PayFields.config.dicountdiscount = {discount number};
  PayFields.config.shipping = {shipping number};
  PayFields.config.duty = {duty number};
  PayFields.config.items = {items Object}
</script>

Result: Example HTML File

Code Block
languagehtml
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript" src="https://test-api.payrix.com/payFieldsScript"></script>
  <title>PayFields Test</title>
</head>
<body>
<input type="button" id="submit" value="Pay"></input>
  <!-- Button needed for PayFrame -->
<script>
    PayFields.button = {element: "#submit", value: "Pay"};
</script>
<script>
  PayFields.fields = [
    {type: "number", element: "#number"},
    {type: "cvv", element: "#cvv"},
    {type: "name", element: "#name"},
    {type: "address", element: "#address"},
    {type: "expiration", element: "#expiration"},
    {type: "tax", element: "#tax"},
    {type: "order", element: "#order"},
    {type: "dicountdiscount", element: "#dicount#discount"},
    {type: "shipping", element: "#shipping"},
    {type: "duty", element: "#duty"},
    {type: "items", element: "#items"}
  ];
</script>
<script>
  PayFields.config.apiKey = "ab123c4def5g6hijkl7890m12345no6p";
  PayFields.config.merchant = "t1_mer_123ab4c567defg8h90123i45";
  PayFields.config.amount = 500;
  PayFields.config.order = {orderNumber};
  PayFields.config.tax = {taxRatePercent};
  PayFields.config.dicount = {discountNumber};
  PayFields.config.shipping = {shippingNumber};
  PayFields.config.duty = {duty number};
  PayFields.config.items = {items Object};
  PayFields.config.billingAddress = {
    address: '123 Madison Street',
    city: 'New York',
    state: 'NY',
    zip: '12345',
    email: '',
    phone: '5555555555',
    address2: 'Suite 555',
    company: 'Essential Co',
    country: 'USA'
  };
  PayFields.config.invoiceResult = {invoiceObject}
</script>
</body>
</html>

...