Summary

This document describes how to integrate the One Inc’s ClaimsPay PortalOne Javascript Library into an existing web based application and invoke the ClaimsPay modals. When the method is invoked, a modal will open which will create or update a ClaimsPay Account and allow a user to make a payment, save a payment method or send an ePay request based upon the provided parameters. There are two types of ClaimsPay Accounts with slight differences in business logic: company and individual.

Requirements

Browsers Compatibility

We support the latest versions of the following browsers and platforms. On Windows, we support Internet Explorer 10+. Support of older verions of Internet Explorer may be available at the time of contract negotiation. More specific support information is provided below.

Chrome Firefox Internet Explorer Safari
Android Supported Supported N/A N/A
iOS Supported N/A N/A Supported
Mac OS X Supported Supported N/A Supported
Windows Supported Supported Supported Not Supported

Embedded Payment Form

Loading plugin

To load the One Inc ClaimsPay JavaScript API, use a script tag like the one in the following example:

<script async defer src="https://stgportalone.processonepayments.com/ClaimsPay/{Your Company Name}/Modal/Cdn/ClaimsPay.js" type="text/javascript"></script>

The URL contained in the script tag is the location of a JavaScript file that loads all of the symbols and definitions you need to use the ClaimsPay™ JavaScript API. The async attribute instructs the browser to render the rest of your website while the ClaimsPay JavaScript API loads. When the API is ready, it will trigger a corresponding event as described in the Events section below.

Plugin initialization

For the modal to display on a web page, you must reserve a spot for it. Commonly you do this by creating a named div element and obtaining a reference to this element in the browser's document object model (DOM).

<div id="claimsPayContainer"></div>

Getting Session Id

The next thing you should do before initiating your client side invocation is to obtain a Session Id from the ClaimsPay API. This step establishes an additional server to server handshake which significantly increases security of every subsequent operation.

In order to complete your integration you need a ClaimsPay authentication key. This key uniquely identifies you as a customer and it is your responsibility to keep your authentication key secure. To help encourage good security practices, client side requests which would expose the authentication key are not permitted and a server-side request to obtain the Session Id is required. If you do not have your ClaimsPay Authentication Key, please feel free to reach out to us and we can issue one.

GET https://stgportalone.processonepayments.com/ClaimsPay/api/Session/Create

Get Session Id Request

Field Name Description Type
ClaimsPayAuthenticationKey Unique identifier string
Request Example:

  ?ClaimsPayAuthenticationKey=AuthenticationKey

Get Session Id Response

Field Name Description Type
SessionId Unique Session Id returned from ClaimsPay. Valid for one operation string
ResponseCode Operation response code string
ResponseMessage Error Response message string
Response Example:
{
   "SessionId": "0c587795-de71-4a28-b1a0-e21e34478c95",
   "ResponseCode": "Success",
   "ResponseMessage": null
}

Embedded Form API

  • Making a payment

    You can invoke the functions in the library directly by writing JavaScript. Important Note: In order to get payment results, you must wire up to the events exposed by the library.

    $('#claimsPayContainer').claimsPay();
    $('#portalOneContainer').data('claimsPay')
        .ClaimsPayModal({
            "SessionId": "c74307aa-68c0-4bfa-bb26-e2e77f789066",
            "AccountId": "12345",
            "Context": "payment",
            "ClaimNumber": "C12345",
            "Amount": "650.00",
            "CompanyDetails": {
                "CompanyName": "Main Street Body Shop",
                "TaxID": "123456789",
                "Address": "123 Main St.",
                "City": "Folsom",
                "State": "CA",
                "Zip": "95630",
                "ContactDetails": {
                    "FirstName": "Janet",
                    "LastName": "Smith",
                    "Email": "test@oneincsystems.com",
                    "Phone": "1234567890",
                }
            }
        });
    
    $('#claimsPayContainer').claimsPay();
    $('#portalOneContainer').data('claimsPay')
        .ClaimsPayModal({
            "SessionId": "c74307aa-68c0-4bfa-bb26-e2e77f789066",
            "Context": "payment",
            "ClaimNumber": "C12345",
            "Amount": "650.00",
            "SourceUser": "",
            "AccountGroupCode": "",
            "IndividualDetails": {
                "FirstName": "Janet",
                "LastName": "Smith",
                "Email": "test@oneincsystems.com",
                "Address": "123 Main St.",
                "City": "Folsom",
                "State": "CA",
                "Zip": "95630",
                "Phone": "1234567890"
            }
        });
    
  • Saving a payment method

    Starting a save payment method process using a Programmatic JavaScript API approach. The following example calls the same function as the example above.

    $('#claimsPayContainer').claimsPay();
    $('#portalOneContainer').data('claimsPay')
        .ClaimsPayModal({                     
            "SessionId": "c74307aa-68c0-4bfa-bb26-e2e77f789066",
            "AccountId": "12345",
            "Context": "save",
            "EPayAllowed": true,
            "ClaimNumber": "C12345",
            "CompanyDetails": {
                "CompanyName": "Main Street Body Shop",
                "TaxID": "123456789",
                "Address": "123 Main St,",
                "City": "Folsom",
                "State": "CA",
                "Zip": "95630",
                "ContactDetails": {
                    "FirstName": "Janet",
                    "LastName": "Smith",
                    "Email": "test@oneincsystems.com",
                    "Phone": "1234567890",
                }
            }
        });
    
    $('#claimsPayContainer').claimsPay();
    $('#portalOneContainer').data('claimsPay')
        .ClaimsPayModal({                     
            "SessionId": "c74307aa-68c0-4bfa-bb26-e2e77f789066",
            "AccountId": "12345",
            "Context": "save",
            "EPayAllowed": true,
            "ClaimNumber": "C12345",
            "IndividualDetails": {
                "FirstName": "Janet",
                "LastName": "Smith",
                "Email": "test@oneincsystems.com",
                "Address": "123 Main St.",
                "City": "Folsom",
                "State": "CA",
                "Zip": "95630",
                "Phone": "1234567890"
            }
        });
    

Request Objects

In order to succesfully load the ClaimsPay modal window, you need to pass a proper data object to ClaimsPay plug-in. The data object is a simple JSON object. If any of the required fields are not included in the data object, the ClaimsPay API will trigger an error event.

  • Request Data Object

    Here you can find a detailed explanation of every field in the data object that is required to load a ClaimsPay modal window. If you are using HTML attributes, see How to map data object fields to HTML attributes .

    Field Name Description Type Note
    sessionId Unique identifier acquired from ClaimsPay Api. Session Id is only valid for a single operation. Once that operation is completed a new Session Id must be acquired. string Required
    AccountId The Account identifier that was returned from the claims system when the company or individual account was created in ClaimsPay. If a value is not included, the system will create a new ClaimsPay account. string Optional
    ClaimNumber The claim number that is associated to the operation. number Required for payment context only
    Context Defines if the modal is being used to save a ClaimsPay account payment method or to make a payment Context Required
    CompanyDetails Details on a company payee. CompanyDetails Required for company requests when AccountId is not provided
    IndividualDetails Details on an individual account. IndividualDetails Requiredfor individual requests when AccountId is not provided
    Amount The amount of the claim payment. string Required for make payment operations
    AccountGroupCode For context of payment, this field is used to route money to different accounts based on a predefined groups. string Optional
    EpayAllowed Flag to determine if ePay should be offered as an option. Boolean Optional
    SourceUser Source system user identifier/name for reporting purposes. string Optional.
  • Context

    ClaimsPay requires you to provide a context option which defines if the modal is being used to save a payment method to a ClaimsPay account or to make a payment. The context field is required for every operation. If this field is not included in the request, the ClaimsPay API will trigger an error event.

    Option NameDescriptionType
    save

    Used to invoke ClaimsPay Save modal

    string

    payment

    Used to invoke ClaimsPay Payment modal

    string

  • Company Details

    ClaimsPay has both company and individual account types. This field will supply or update the company and contact information for the ClaimsPay account. The CompanyDetails field is required if the request does not include the AccountId or IndividualDetails. If the AccountId is not provided with the request, the system will create a new company ClaimsPay account based off of the provided information. If the AccountId is provided with the request, the system will update the stored CompanyDetails information. If the request does not include either the AccountId, CompanyDetails or IndividualDetails, the ClaimsPay API will trigger an error event.

    Field NameDescriptionTypeNote
    CompanyName

    Specifies the name of the company entity.

    string

    Required
    TaxId

    Specifies The tax ID for the company entity. As unique identifier can be used to present saved payment methods for company entity on the epay webpage.

    string

    Optional
    Address

    The physical street address for the company.

    string

    Required
    City

    The city for the company.

    string

    Required
    State

    The state for the company.

    string

    Required
    Zip

    The zip code for the company.

    string

    Required
    ContactDetails

    Details on the company contact person to whom the payment method will be associated.

    ContactDetails Required
  • Individual Details

    ClaimsPay has both company and individual account types. This field will supply or update the individual information for the ClaimsPay account. The IndividualDetails field is required if the request does not include the AccountId or CompanyDetails. If the AccountId is not provided with the request, the system will create a new individual ClaimsPay account based off of the provided information. If the AccountId is provided with the request, the system will update the stored IndividualDetails information. If the request does not include either the AccountId, CompanyDetails or IndividualDetails, the ClaimsPay API will trigger an error event.

    Field NameDescriptionTypeNote
    FirstName

    The first name of the Payee to whom the payment method will be associated.

    string

    Required
    LastName

    The last name of the Payee to whom the payment method will be associated.

    string

    Required
    Email

    The Payee’s email address; will pre-populate ePay email Address if available.

    string

    Required
    Phone

    The Payee's phone number.

    string,
    10 digits

    Required
    Address

    The street address for the individual payee.

    string

    Required
    City

    The city for the individual payee.

    string

    Required
    State

    The state for the individual payee.

    string

    Required
    Zip

    The zip code for the individual payee.

    string

    Required
  • Contact Details

    ClaimsPay allows you to have multiple contacts associated to a company ClaimsPay account. This field will supply or update information for the contact associated to a company. If there are multiple contacts, the payment methods associated to the company account will be accessible for all contacts. Note, ClaimsPay does not restrict the creation of company accounts by TaxId or other properties, so based upon your business rules you can choose to create multiple company records with one contact. If the ContactDetails includes a value for ContactId, the system will update the data stored for the Contact. If the ContactDetails does not include a value for ContactId, the system will create a new Contact associated to the company. If this ContactId and ContactDetails are not provided in the request, the ClaimsPay API will trigger an error event.

    Field NameDescriptionTypeNote
    ContactId

    The contactId that is stored in the ClaimsPay system for the company contact.

    number

    Optional
    FirstName

    The first name of the company contact to whom the payment method will be associated.

    string

    Required
    LastName

    The last name of the company contact to whom the payment method will be associated.

    string

    Required
    Email

    The email address for the company contact; will pre-populate ePay email Address if available.

    string

    Required
    Phone

    The phone number for the company contact.

    string,
    10 digits

    Required
    WebAccess

    Value that will indicate if the contact will have access to the company prepaid card self-service website. If property is not provided, default value is enable.

    WebAccess Optional
  • Web Access

    Enum NameValueDescription
    Enabled 0

    Grants the contact access to the company website.

    Disabled 1

    Denies the contact access to the company website.

Events

The ClaimsPay provides custom events for most plugins’ unique actions. You can attach and detach event handler functions using standard JavaScript API. The ClaimsPay library declares the following events:

  • Modal Load Event

    Code: claimsPay.load
    Occurs when modal dialog is loaded.
  • Modal Unload Event

    Code: claimsPay.unload
    Occurs when modal dialog is unloaded.

  • Code: claimsPay.error
    Occurs on errors.
    Field Name Description Type
    description Error details FailReason

    FailReason object

    Field Name Description Type
    description Collection of error messages Array of Array of string
    Example:
    {
      "description": {
        "paymentCategory": [
          "paymentCategory is a required field"
        ],
       "paymentUid": [
          "Incorrect format"
        ]
      }
    }
  • Payment Complete Event

    Code: claimsPay.paymentComplete
    Occurs when payment is successfully completed.
    Field Name Description Type
    paymentInfo Payment details PaymentInfo

    PaymentInfo object

    Field Name Description Type Note
    AccountId Returns One Inc unique identifier for the individual or company ClaimsPay account. number Returned for all payment method types
    ContactId Returns contact identifier for a company contact. Only returned for company accounts string Returned for all payment method types
    TransactionId Returns Digital Payments Transaction ID, payment identifier. string Returned for all payment method types
    TransactionDate Returns date stamp for the payment transaction. DateTime Returned for all payment method types
    TimeZone Returns timezone code (ex. Pacific, Eastern) string Returned for all payment method types
    Amount The total amount of the payment that was processed or submitted. decimal Returned for all payment method types
    PaymentMethodType Returns the type of the payment method (ECheck, PrepaidAccount). string Returned for all payment method types
    BankAccountSummary Bank Account summary information including token string Returned for ECheck only.
    PrepaidAccountBalance Returns the remaining ballance of the prepaid account. string Returned for PrepaidAccount only.
    Credit Card PaymentInfo Object Example:
    {
      "AccountId": 56,
      "TransactionId": "10436398",
      "TransactionDate": "06/25/2018 05:29:55 PM PDT",
      "TimeZone": "Pacific",
      "Amount": "120.00",
      "PaymentMethodType": "ECheck",		  
      "BankAccountSummary": {
        "Token": "d9f152f2-e177-4b9f-97a0-3b0261ec8318",
        "AccountType": "Checking",
        "LastFourDigits": "3123",
        "BankName": "JPMORGAN CHASE BANK",
        "NameOnAccount": "Janet Smith"
      }
    }
    
  • Canceled Event

    Code: claimsPay.canceled
    Occurs when operation is canceled.
  • Save Complete Event

    Code: claimsPay.saveComplete
    Occurs when payment method was successfully saved.
    Field Name Description Type
    paymentInfo Payment method details SavePaymentInfo

    SavePaymentInfo object

    Field Name Description Type Note
    AccountId Returns One Inc unique identifier for the individual or company ClaimsPay account. number Returned for all payment method types
    ContactId Returns contact identifier for a company contact. Only returned for company accounts string Returned for all payment method types
    PaymentMethodType Returns the type of the payment method (ECheck, PrepaidAccount, EPay). string Returned for all payment method types
    EPaySummary EPay request information. EPaySummary Returned for EPay only.
    BankAccountSummary Bank Account summary information including token BankAccountSummary Returned for ECheck only.

    EPaySummary

    Field Name Description Type
    EPayRequestId Unique identifier for the ePay request. string
    EPayEmailAddress EmailAddress to which ePay was sent. enum

    BankAccountSummary

    Field Name Description Type
    Token Saved bank account token. string
    AccountType Checking / Savings enum
    LastFourDigits Last four digits of the bank account number. string
    BankName Name of Bank based off of Routing Number. string
    NameOnAccount Name on Bank Account. For Individual it will be PayeeName, for Company will be Company Name. string
    SavePaymentInfo Object Example:
    {
      "AccountId": 58,
      "PaymentMethodType": "ECheck",
      "ContactId": 35,
      "BankAccountSummary": {
        "Token": "24b5e217-1848-453f-8288-81ee381f01b8",
        "AccountType": 0,
        "LastFourDigits": "1234",
        "BankName": "JPMORGAN CHASE BANK",
        "NameOnAccount": "Main Street Body Shop"
      }
    }
    

Test Data

You can use the following EFT data for testing purposes.

Account Number Routing Number Account Type
123456789 121042882 Checking

Use the following bank account number and amount combination to simulate different API response codes.

Test Data for Credit and Debit transaction types.
Account Number Amount Response Code Description
1234567890 $0.00 Success Test: Successfully saved
1234567890 $1.00 Success Test: Transaction approved
1234567890 $2.00 ACHTransactionFailed Test: Not able to process bank account payment
1234567890 $3.00 GatewayInternalError Test: System is down
1234567890 $4.00 NoProcessorResponse Test: No response from Processor
Test Data for Void and Refund transaction types. You can only void or refund an already existing transaction.
Account Number Amount Response Code Description
1234567890 $11.00 ACHTransactionFailed Test: Not able to process bank account payment
1234567890 $12.00 GatewayInternalError Test: System is down
1234567890 $13.00 NoProcessorResponse No response from Processor

You can use the following EFT data to simulate Bank Account Validation response codes.

For testing, any valid routing number shall be used. The results will depend on bank account number.
Account Number Response Code Description
1234567890 Success Test: Charge approved
2234567890 InvalidAccountNumber Test: Invalid Account Number
3234567890 InvalidRoutingNumber Test: Invalid Routing Number
4234567890 GatewayInternalError Test: System is down