• User Documentation 
  • Amaryllis Release Notes 
  • For Developers 

  • User Documentation 
  • Amaryllis Release Notes 
  • For Developers 

Heartland - Dev Portal

  • folder icon closed folder iconIntroduction
  • folder icon closed folder iconAuthentication
  • folder icon closed folder iconManagement
    • Getting Started
    • Platform Accounts Management
      • Get Platform Account Configuration
      • Get Platform Account
      • Create Platform Account
      • Update Platform Account
      • Objects Reference
    • Sub-Accounts Management
      • Get Sub-Account Configurations
      • Get Sub-Account
      • Create Sub-Account
      • Update Sub-Account
      • Objects Reference
    • Users Management
      • Get User by User Id
      • Get User by Username
      • Create User
      • Update User
      • Objects Reference
    • Underwriting Management
      • Get Application
      • Get Application Template
      • Get Application Fields Statuses
      • Get Application Status
      • Get Linked Sub-Accounts
      • Get Resubmission
      • UMS IFrame Authentication
      • UMS IFrame
      • UMS IFrame Authentication in Resubmission Mode
      • UMS IFrame in Resubmission Mode
      • Create Application
      • Update Application
      • Update Application Fields Statuses
      • Update Application Status
      • Objects Reference
      • Response Codes
  • folder icon closed folder iconTransactions Processing
    • Getting Started
    • Credit Card Transactions
      • 3D-Secure
      • Authorization
      • Void
      • Capture
      • Charge
      • Refund
      • Credit
      • Verify
      • Chargeback
      • Cancel
    • Update
    • Adjustment
    • Recurring
    • ACH
    • Response
    • Response Codes
    • Objects Reference
  • folder icon closed folder iconTransactions Echo
    • Getting Started
    • Credit Card Transactions
      • Authorization
      • Void
      • Capture
      • Charge
      • Refund
      • Credit
      • Verify
      • Chargeback
      • Cancel
    • Update
    • Adjustment
    • ACH
    • Echo Response
    • Response Codes
    • Objects Reference
  • folder icon closed folder iconTokenization
    • Processing with a Token
      • Getting Started
      • Processing with Tokenization
    • Tokenization iFrame
      • iFrame Integration
      • iFrame Customization
      • iFrame Testing
      • Response Example
    • Tokenization API
      • Getting Started
      • Tokenization Request
      • Tokenization Response
      • Response Codes
  • folder icon closed folder iconPayouts
    • Getting Started
    • Payout Transactions
    • Response
    • Objects Reference
  • folder icon closed folder iconReports
    • Getting Started
    • Reports API
      • Account Balances
      • Payouts
      • Payouts Reconciliation
      • Transaction Details
      • Settlements
      • Account Summary
      • Transactions
      • Transactions Summary
      • Fees Summary
      • Incoming Fees
      • Expected Future Revenue
      • Profitability Analysis
      • Reconciliation Summary
      • Reconciliation Records
      • Chargeback Analysis
      • Tokens
      • Sign-up Summary
    • Status Codes
  • folder icon closed folder iconErrors
  • folder icon closed folder iconResponse Codes
  1. Home
  2. Docs
  3. Heartland – Dev Portal
  4. Tokenization
  5. Tokenization iFrame
  6. iFrame Testing
Updated on June 9, 2023

Heartland - Dev Portal

  • folder icon closed folder iconIntroduction
  • folder icon closed folder iconAuthentication
  • folder icon closed folder iconManagement
    • Getting Started
    • Platform Accounts Management
      • Get Platform Account Configuration
      • Get Platform Account
      • Create Platform Account
      • Update Platform Account
      • Objects Reference
    • Sub-Accounts Management
      • Get Sub-Account Configurations
      • Get Sub-Account
      • Create Sub-Account
      • Update Sub-Account
      • Objects Reference
    • Users Management
      • Get User by User Id
      • Get User by Username
      • Create User
      • Update User
      • Objects Reference
    • Underwriting Management
      • Get Application
      • Get Application Template
      • Get Application Fields Statuses
      • Get Application Status
      • Get Linked Sub-Accounts
      • Get Resubmission
      • UMS IFrame Authentication
      • UMS IFrame
      • UMS IFrame Authentication in Resubmission Mode
      • UMS IFrame in Resubmission Mode
      • Create Application
      • Update Application
      • Update Application Fields Statuses
      • Update Application Status
      • Objects Reference
      • Response Codes
  • folder icon closed folder iconTransactions Processing
    • Getting Started
    • Credit Card Transactions
      • 3D-Secure
      • Authorization
      • Void
      • Capture
      • Charge
      • Refund
      • Credit
      • Verify
      • Chargeback
      • Cancel
    • Update
    • Adjustment
    • Recurring
    • ACH
    • Response
    • Response Codes
    • Objects Reference
  • folder icon closed folder iconTransactions Echo
    • Getting Started
    • Credit Card Transactions
      • Authorization
      • Void
      • Capture
      • Charge
      • Refund
      • Credit
      • Verify
      • Chargeback
      • Cancel
    • Update
    • Adjustment
    • ACH
    • Echo Response
    • Response Codes
    • Objects Reference
  • folder icon closed folder iconTokenization
    • Processing with a Token
      • Getting Started
      • Processing with Tokenization
    • Tokenization iFrame
      • iFrame Integration
      • iFrame Customization
      • iFrame Testing
      • Response Example
    • Tokenization API
      • Getting Started
      • Tokenization Request
      • Tokenization Response
      • Response Codes
  • folder icon closed folder iconPayouts
    • Getting Started
    • Payout Transactions
    • Response
    • Objects Reference
  • folder icon closed folder iconReports
    • Getting Started
    • Reports API
      • Account Balances
      • Payouts
      • Payouts Reconciliation
      • Transaction Details
      • Settlements
      • Account Summary
      • Transactions
      • Transactions Summary
      • Fees Summary
      • Incoming Fees
      • Expected Future Revenue
      • Profitability Analysis
      • Reconciliation Summary
      • Reconciliation Records
      • Chargeback Analysis
      • Tokens
      • Sign-up Summary
    • Status Codes
  • folder icon closed folder iconErrors
  • folder icon closed folder iconResponse Codes

iFrame Testing

Follow this URL: https://sandbox.4levers.com/TokenizationIframe/

Sandbox Environment JavaScript Reference: https://sandbox.4levers.com/TokenizationApi/Scripts/fourlevers.js

Test API Key: e9d0242db35c4a59a74cf48fe5a92da0

Test Input Data:

Test credit card number: 4111111111111111

Name on card: Eleanor Johnson

Credit card expiration date: 11/2025

CVV: 123

 

				
					<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:mso="urn:schemas-microsoftcom:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
    <head>
        <title>Tokenization integration sample</title>
        <!-- add 4levers script reference with specified client api key -->
        <script src="https://sandbox.4levers.com/TokenizationApi/Scripts/fourlevers.js" data-4levers-key="e9d0242db35c4a59a74cf48fe5a92da0" data-theme='sample' ></script>
        <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

        /* iFrame Style*/
                <style>
             label, input, select {
             display: block;
             margin-left: 8px;
             width: 170px;
            }
             .fourlevers-iframe {
             border: none;
             height: 400px;
             width: 250px;
             }
        </style>

    </head>
    <body>
 <!-- customer fields -->
     <form>
         <div>
         <label for="addressLine">Address Line 1</label>
         <input name="addressLine" id="addressLine" type="text" maxlength="50" />
         </div>
         <div>
         <label for="addressLine2">Address Line 2</label>
         <input id="addressLine2" name="addressLine2" type="text" maxlength="50" />
         </div>
         <div>
         <label for="city">City</label>
         <input id="city" name="city" type="text" maxlength="50" />
         </div>
        <div>
        <label for="country">Country</label>
        <select id="country" name="country">
             <option value="1">USA</option>
             <option value="2">Canada</option>
             <option value="3">United Kingdom</option>
        </select>
         </div>
        <div>
         <label for="phone">Phone</label>
         <input id="phone" name="phone" type="tel" maxlength="15" />
         </div>
     </form>
     <!-- div container for tokenization iframe -->
    <div id="container"></div>
     <input type="button" value="submit" onclick=" submitData() " />
     <input type="button" value="reset" onclick="reset()"/>
    <script>
            $().ready(function () {
                 //create tokenization iframe element on the page inside the element with
                id='container'
                 fourlevers.createIframe('container');
             });

             //submit button handler
             function submitData() {
                 //sending iframe data to 4levers to obtain token (if validation passed)
                 //tokenizationComplete - callback function
                 fourlevers.fetchTokenizedData(tokenizationComplete);
             }
             //reset button handler
               function reset() {
             fourlevers.resetIframe();             
             }
             //tokenization complete callback
             function tokenizationComplete(tokenizationData) {
                 //check response status (200 - OK, 400 - Bad Request, 500 - Server Error)
                 if (tokenizationData.status === 200) {
                     //perform any operation that you need
                     alert(JSON.stringify(tokenizationData));
                     $.post('[some client url]', tokenizationData)
                     .done(function (data) {

                     });

                }
             }
    </script>
    </body>
 </html>				
			
Still stuck? How can we help?
Was this page helpful? Yes No

How can we help?

© Amaryllis Payment Solutions, 2022  All rights reserved.