onBlur Callback

The onBlur( ) callback invokes the function registered against this event when the hosted field in the iFrame has lost focus.

Usage

PaymentSession.onBlur([<HostedFieldsRole>], function(selector, role), [scope])

Example

PaymentSession.onBlur(['card.number','card.securityCode'], function(selector, role) {
    //handle blur event
});

Arguments

<HostedFieldsRole> Array COMPULSORY

An array of field roles for the hosted fields where the event occurred. Valid array of field roles: ['card.nameOnCard', 'card.number', 'card.expiryMonth', 'card.expiryYear', 'card.securityCode', 'giftCard.number', 'giftCard.pin', 'ach.bankAccountNumber', 'ach.bankAccountNumberConfirmation', 'ach.bankAccountHolder', 'ach.routingNumber', 'directDebitCanada.bankAccountNumberConfirmation', 'directDebitCanada.bankAccountHolder', 'directDebitCanada.bankAccountNumber', 'directDebitCanada.financialInstitutionNumber', 'directDebitCanada.transitNumber']

<callbackFunction> Function COMPULSORY

The callback function invoked with the selector and the role for the field whose proxy triggered the event.

  1. selector String COMPULSORY

    Identifier of the HTML element that has lost the focus (ex: "#card-number").

  2. role String COMPULSORY

    Valid array of field roles: ['number', 'nameOnCard', 'expiryMonth', 'expiryYear', 'securityCode', 'pin', 'bankAccountNumber', 'bankAccountNumberConfirmation', 'bankAccountHolder', 'routingNumber', 'financialInstitutionNumber', 'transitNumber']

scope String OPTIONAL

The optional named instance of a card payment data set within a session. See Multiple Hosted Sessions for more information.

Return Value

None

Copyright © 2023 Mastercard