onChange Callback

The onChange( ) callback invokes the function registered against this event when the input value in the hosted field in the iFrame has changed.

Usage

PaymentSession.onChange([<HostedFieldsRole>], function(selector))

Example

PaymentSession.onChange(['card.number','card.securityCode'], function(selector) {
    //handle change event
});

Arguments

<HostedFieldsRole> Array COMPULSORY

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

<callbackFunction> Function COMPULSORY

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

Return Value

None

Copyright © 2023 MasterCard