Hosted Payments Page

Secure Payment Processing Integration Guide

Configuration Options

Required Parameters

Parameter Type Description
Target string ID of the HTML element where the iframe will be embedded
HPPUrl string Base URL of the hosted payments page service
Token string Bearer authentication token for API access
MerchantId string Unique identifier for the merchant account

Payment Type Options

Note: At least one payment type must be enabled. The merchant account must also be configured to accept the selected payment types.
Parameter Type Default Description
ShowPaymentTypeCc boolean false Enable credit card payment option
ShowPaymentTypeAch boolean false Enable ACH bank transfer payment option
ShowPaymentTypeSwipe boolean false Enable card swipe reader option (MSR90 compatible)
InitialPaymentType string (required) Initial payment type to display: "CC", "ACH", or "SWIPE". If omitted, OnError fires with "No options specified for HPP."
AllowPaymentTypeToggle boolean false Allow users to switch between payment types

UI Customization

Parameter Type Default Description
ShowAddress boolean false Display address fields (street, city, region)
ShowPhone boolean false Display phone number field
ShowEmail boolean false Display email address field
ShowCancel boolean false Display cancel button
HideSubmit boolean false Hide the submit button (for custom submit handling)
SubmitButtonText string "Pay Now" Custom text for submit button
CancelButtonText string "Cancel" Custom text for cancel button
Style string "" URL to custom CSS or inline CSS for styling
Height string "100%" Initial iframe height (auto-adjusts based on content)
Width string "100%" Iframe width

Transaction Settings

Parameter Type Default Description
AllowPartial boolean true Allow partial payment amounts
AllowDuplicateTransaction boolean false Allow processing of duplicate transactions
AllowTransactionalEmails boolean false Permit transactional emails (e.g., saved-payment-method confirmations) to be sent by downstream services
EnforceSurchargeCompliance boolean false Enforce surcharge compliance rules
OrderId string "" External order or invoice identifier
LocationId number null Location identifier for multi-location merchants
TransactionEntrySource number null Source identifier for transaction tracking
CorrelationID string auto-generated Correlation ID for request tracing (auto-generates UUID if not provided)
LimitedBitFlag boolean false Use limited bit IDs for specific processing requirements

Profile Management

Parameter Type Default Description
PayorId string "" Pre-populate form with existing payor profile
RemoveSave boolean false Remove the "save payment method" checkbox
SaveOnly boolean false Only save payment method without processing a payment

Advanced Options

Parameter Type Description
FieldVisibility object Object mapping field IDs to boolean visibility values
PresetValues object Object mapping field IDs to pre-filled values

Configuration Examples

Minimal Configuration (Credit Card Only)

var paymentWidget = new hpp({
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",
    ShowPaymentTypeCc: true,
    InitialPaymentType: "CC"
});

Full-Featured Configuration

var paymentWidget = new hpp({
    // Required
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",

    // Payment types
    ShowPaymentTypeCc: true,
    ShowPaymentTypeAch: true,
    ShowPaymentTypeSwipe: false,
    InitialPaymentType: "CC",
    AllowPaymentTypeToggle: true,

    // UI customization
    ShowAddress: true,
    ShowPhone: true,
    ShowCancel: true,
    HideSubmit: false,
    SubmitButtonText: "Complete Payment",
    CancelButtonText: "Go Back",
    Style: getCustomCSS(),
    Height: "100%",
    Width: "100%",

    // Transaction settings
    AllowPartial: true,
    AllowDuplicateTransaction: false,
    EnforceSurchargeCompliance: true,
    OrderId: "ORDER-2026-001",
    LocationId: 42,
    TransactionEntrySource: 1,
    CorrelationID: generateCorrelationId(),
    LimitedBitFlag: false,

    // Profile management
    PayorId: "",
    RemoveSave: false,
    SaveOnly: false,

    // Advanced options
    FieldVisibility: {
        "Request_Email": true,
        "Request_Phone": true,
        "Request_Address": true
    },
    PresetValues: {
        "Request_Email": "customer@example.com"
    },

    // Event handlers
    OnLoaded: handleLoaded,
    OnSuccess: handleSuccess,
    OnDecline: handleDecline,
    OnError: handleError,
    OnCancel: handleCancel,
    OnChangePaymentType: handlePaymentTypeChange,
    OnBinLookupResponse: handleBinLookup,
    OnAmountChanged: handleAmountChange
});

Save Payment Method Only

var paymentWidget = new hpp({
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",
    ShowPaymentTypeCc: true,
    ShowPaymentTypeAch: true,
    InitialPaymentType: "CC",
    SaveOnly: true,              // Only save, don't charge
    RemoveSave: true,            // Hide save checkbox (always saves)
    SubmitButtonText: "Save Payment Method",
    ShowAddress: true,
    OnSuccess: function(response) {
        console.log("Payment method saved:", response.PayorId);
    }
});

Pre-populated Form

var paymentWidget = new hpp({
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",
    ShowPaymentTypeCc: true,
    InitialPaymentType: "CC",
    ShowAddress: true,
    ShowPhone: true,

    // Pre-fill customer data
    PresetValues: {
        "Request_Name": "Jane Smith",
        "Request_Email": "jane@example.com",
        "Request_Address": "123 Main St",
        "Request_City": "Springfield",
        "Request_Region": "IL",
        "Request_Postal": "62701",
        "Request_Phone": "2175551234"
    },

    OnLoaded: function() {
        console.log("Form loaded with preset values");
    }
});

Custom Styling

// Define custom CSS
var customCSS = `
    body {
        font-family: 'Arial', sans-serif;
        background-color: #f8f9fa;
    }

    .payment-form {
        max-width: 500px;
        margin: 0 auto;
        padding: 20px;
    }

    .field label {
        color: #333;
        font-weight: 600;
    }

    .field input,
    .field select {
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
    }

    .btn-primary {
        background-color: #007bff;
        border-color: #007bff;
        padding: 12px 24px;
        font-size: 16px;
    }

    .btn-primary:hover {
        background-color: #0056b3;
    }
`;

var paymentWidget = new hpp({
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",
    ShowPaymentTypeCc: true,
    InitialPaymentType: "CC",
    Style: encodeURIComponent(customCSS)  // Encode CSS for URL
});

Dynamic Field Visibility

var paymentWidget = new hpp({
    Target: "payment-container",
    HPPUrl: "https://your-payment-domain.com/",
    Token: "your-bearer-token",
    MerchantId: "merchant-123",
    ShowPaymentTypeCc: true,
    ShowPaymentTypeAch: true,
    InitialPaymentType: "CC",
    AllowPaymentTypeToggle: true,

    // Initially hide phone, show after loading
    FieldVisibility: {
        "Request_Phone": false
    },

    OnLoaded: function() {
        // Show phone field after a delay
        setTimeout(function() {
            paymentWidget.ToggleFields({
                "Request_Phone": true
            });
        }, 1000);
    },

    OnChangePaymentType: function(paymentType) {
        // Show/hide fields based on payment type
        if (paymentType === "ACH") {
            paymentWidget.ToggleFields({
                "Request_Phone": true,
                "Request_Address": true
            });
        } else {
            paymentWidget.ToggleFields({
                "Request_Phone": false,
                "Request_Address": false
            });
        }
    }
});