Reference every component shipped with Cashfree.js, the initial state options accepted by each one, and which components are payable on a custom checkout.
Cashfree provides the following list of components along with the initial state that can be passed in options.values. Certain components are payable and might need other components to be mounted to be ready for payment
A component can only be mounted after cashfree.js has been initialized and
DOM container is ready for mounting the component.
You can get the value of a component by calling component.data().value. All returned
values of component.data() can be found in the components reference
A component to accept card holder’s namekindinputpayablefalse
Accepted values
You can pass values to a component using optionscashfree.create('componentName', options)
key
description
placeholder stringOPTIONAL
placeholder for your card number field
cardHolder stringOPTIONAL
name of your customer
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
A component to accept card expirykindinputpayablefalse
Accepted values
Does not accept anything
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
key
description
cardExpiry string
card expiry in MM/YY format
Example
let cashfree = Cashfree({ mode: "sandbox", //or production});let cardExpiry = cashfree.create("cardExpiry", { values: { //does not accept any value },});cardExpiry.on("loaderror", function (data) { console.log(data.error);});cardExpiry.mount("#mount-here");cardCvv.on("ready", function (d) { console.log(cardCvv.data().value); //{cardExpiry: '12/26'} //or //console.log(d.value)});
A component to accept card cvv/cvckindinputpayablefalse
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
key
description
cardCvv number
card cvv
Example
let cashfree = Cashfree({ mode: "sandbox", //or production});let cardCvv = cashfree.create("cardCvv", {});cardCvv.on("loaderror", function (data) { console.log(data.error);});cardCvv.mount("#mount-here");cardCvv.on("ready", function (d) { console.log(cardCvv.data().value); //{cardCvv: '123'} //or //console.log(d.value)});
A component to accept user’s vpa/upi idkindinputpayabletrue
Accepted values
You can pass values to a component using optionscashfree.create('componentName', options)
key
description
placeholder stringOPTIONAL
placeholder for enter vpa field
upiId stringOPTIONAL
vpa/ upi id of the customer
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
key
description
upiId string
vpa/ upi id of the customer
Example
let cashfree = Cashfree({ mode: "sandbox", //or production});let upiCollect = cashfree.create("upiCollect", { values: { upiId: "janedoe1@okbankname", },});upiCollect.on("loaderror", function (data) { console.log(data.error);});upiCollect.mount("#mount-here");upiCollect.on("ready", function (d) { console.log(upiCollect.data().value); //{upiId: 'janedoe1@okbankname'} //or //console.log(d.value)});
A component to initiate UPI app/intent payment. Only works in mobile phones. If you mount it on desktop it will throw an error in loaderrorkindbuttonpayabletrue
Mobile only. Component will not mount on custom webview/inappbrowser Android. It
will however mount in popular apps like Facebook, Instagram, Twitter. For iPhone
it will always mount.
Accepted values
You can pass values to a component using optionscashfree.create('componentName', options)
In case buttonText is not provided the value of buttonIcon would be
replaced to true. This has been done so that your customer always sees icon
of the app.
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
A component to show a UPI qr codekindimagepayabletrue
Accepted values
You can pass values to a component using optionscashfree.create('componentName', options)
key
description
size stringrequired
size of the qr code. ex “220px”
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
key
description
size string
size of the qr code. ex “220px”
Example
let cashfree = Cashfree({ mode: "sandbox", //or production});let upiQr = cashfree.create("upiQr", { values: { size: "220px", },});upiQr.on("loaderror", function (data) { console.log(data.error);});upiQr.mount("#mount-here");upiQr.on("ready", function (d) { console.log(upiQr.data().value); //{size: '220px'} //or //console.log(d.value)});
In case buttonText is not provided the value of buttonIcon would be
replaced to true. This has been done so that your customer always sees icon
of the app.
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
In case buttonText is not provided the value of buttonIcon would be
replaced to true. This has been done so that your customer always sees icon
of the app.
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
In case buttonText is not provided the value of buttonIcon would be
replaced to true. This has been done so that your customer always sees icon
of the app.
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
In case buttonText is not provided the value of buttonIcon would be
replaced to true. This has been done so that your customer always sees icon
of the app.
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
A component that can be used in .pay() to save a payment method for a customer. This works for only cards. This will tokenise your cardkindcheckboxpayablefalse
Accepted values
You can pass values to a component using optionscashfree.create('componentName', options)
key
description
label stringOPTIONAL
Label for the checkbox
Returned value
You can get the value of a component by calling component.data().value. All returned values of component.data() can be found in the components reference
key
description
saveInstrument bool
does the user wants to save
Was this page helpful?
⌘I
Assistant
Responses are generated using AI and may contain mistakes.