Angular iFields
Overview
Our component for the Angular framework simplifies the iFields integration process. This integration allows you to build forms with secure payment fields, giving you the ability to design and customize the look and feel of your payment and checkout flows without having to worry about PCI compliance.
Sandbox: https://www.cardknox.com/sandbox/
iFields: Fields
A sandbox or live account is required to use this component.
Inputs
There are 2 basic inputs required to get this up and running:
1. Type
There are three types of payment data that iFields supports:
Credit Card
CVV
ACH
The possible values for this property are:
card
CVV
ACH
These can be imported from the component.
2. Account
Pass your iFields key to the component in the account input like this:
Events:
There are 2 lifecycle events and 7 user events.
Lifecycle events
1. Load
Is emitted when the iFrame has loaded.
1
<cardknox-ifields (load)="onLoad"></cardknox-ifields>
2. Token
Is emitted when a token is received from the iField.
1
<cardknox-ifields (token)="onToken"></cardknox-ifields>
User events
User events are events passed along from iFields when the user interacts with it.
The available events are:
click
dblclick
focus
blur
input
change
submit*
* the submit event works slightly differently, see below.
Update
Aside from submit, the above events can be collected on a single event update
. This is not recommended as it will cause an unnecessary amount of function calls. Instead, subscribe only to the events you want to act on.
The event payload is in e.data
. The data also contains the event so you can subscribe to multiple events with a single function and a switch
statement, like this:
Submit
This event is triggered when the user submits the form from within the iFrame.
This event works differently from other user events.
This event is only emitted if prop
options.autoSubmit
is true. (this is the default).Subscribing to
update
will not, work as mentioned above.The data passed along with this event is slightly different (see below).
It is also possible to have the component automatically submit the form for you when submit is triggered from the iFrame. If autoSubmitFormId
is set on the options prop, the component will call submit on the element with that ID. This is useful for smaller applications relying on the form element to handle submission.
Error
There is also an error event that can be subscribed to.
Actions
There are 3 actions available on this component as well:
Focus
focusIfield
This action will set the focus to the iField when called.
Clear
clearIfield
This action will clear the data from the iField when called.
Get Token
getToken
This action will load the token for the iField when called.
Inputs
Account
Options
ThreeDS
Update Event Data
Error Data
iFields Version: 2.6.2006.0102
Last updated