Versions Compared

Key

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

...

Expand
titleSubmit Level III data using the Payrix API.

To submit Level III transaction data using the /txns Payrix API endpoint, send the following request:

Code Block
languagejson
{
   "merchant":"{yourMerchantID}",
   "payment":{
      "number":"{customerCardNumber}",
      "cvv":"{customerCardCVV}"
   }
   "expiration":"MMYY",
   "type":2,
   "order":"INVOICE#1",
   "total":7799,
   "tax":100,
   "items":[
      {
         "item":"Line Item #1",
         "description":"Line Item Description"
         "quantity":1,
         "price":7799,
         "um":"EACH",
         "commodityCode":"1111999",
         "total":5799,
         "discount":-2000,
         "productCode":"UPC12345"
      },
   ]
}

Note: Descriptions for Level II data shown here are available in the Submit Level II data using the Payrix API section above.

Required Parameters

Type

Description

Valid Values / Format

items

array of objects

The item or list of items associated with the transaction/order.

item

string

The line item name.

description

string

The line item description.

Max length: 500 characters

quantity

integer

The total number of units for the line item.

price

number

The individual line item price.

um

string

The line item units of measure.

ExmapleExample: “pounds”, “days”, “hours”.

Max length: 100 characters

commodityCode

string

The commodity code for this Item.

Max length:12 characters

total

integer

The total price for the line item.

This field is specified as an integer in cents

discount

integer

The discount for the line item.

This field is specified as an integer in cents.

productCode

string

The product code for this Item such as: UPC, catalog number, or inventory number.

...

Expand
titleSubmit Level II data using PayFields.

Step 1: Under your <script> tag containing PayFields.fields enter the following to add new Tax and Order fields to the PayFields

Code Block
languagehtml
<body>
  <div>
        <label for="numbertax">Number>Tax Rate:</label>
        <div id="number" value="yourTaxRate"></div>
   
  </div>
  <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"}
    ];
  </script>
</body>
Code Block
  <body>
    
  

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>
<div id="submit">
  <!-- Button needed for PayFrame -->
</div>
<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"}
  ];
</script>
<script>
  PayFields.config.apiKey = "ab123c4def5g6hijkl7890m12345no6p";
  PayFields.config.merchant = "t1_mer_123ab4c567defg8h90123i45";
  PayFields.config.amount = 500;
</script>
<script>
  PayFields.customizations = {
    style: {
      ".input": {
        color: "#555",
        font: "14px Arial, Helvetica, sans-serif",
        background: "white"
      }
    }
  }
</script>
</body>
</html>  

...