Log in
Helper

PaypalApiDataFormatter

Magento\PaymentServicesPaypal\Helper\PaypalApiDataFormatter

What it does

This helper class formats and sanitizes data before sending it to PayPal's API.

Developers use it to ensure product information, amounts, descriptions, and other order details meet PayPal's API validation requirements (character limits, format rules).

It handles tasks like truncating strings to maximum lengths, padding UPC codes, formatting currency amounts, and mapping product types to PayPal categories.

Public Methods

  • formatAmount()
  • formatCommodityCode()
  • formatName()
  • formatSku()
  • formatUPCCode()
  • formatDescription()
  • formatUrl()
  • formatCategory()