Skip to main content

EnrollNewCardInHostedFields

Opens card enrollment in hosted fields, caller must provide a WindowProxy either from window or iframe.

Caller is responsible for closing the provided windowRef after method returns.

Method returns an encrypted card and the card brand.

info

It is up to the caller to close the provided windowRef after the method returns.

Initialize the payonic-click2pay.js client
payonicClickToPay.EnrollNewCardInHostedFields(
windowRef: window.Open() | iframe.contentWindow
);
Response
{
encryptedCard: "eyJrZXlJZCI6IjE0OTA2NC1zdGctc3JjLWZwYW4tZW5jcnlwdGlvbiIsImlhdCI6IjE2MTQ5NDM4NTYiLCJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0",
cardBrand: "mastercard"
}