Components
Learn about the components which are available with Cashfree.js
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.
Card components
There are four card components as listed below:
cardNumber
A component to accept card number
Parameters
Returned Value
You can get the value of a component by callingcomponent.data().value
. All returned
values of component.data()
can be found here
cardHolder
A component to accept card holder’s name
kindinput payablefalseAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
placeholder string OPTIONAL | placeholder for your card number field |
cardHolder string OPTIONAL | 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 here
key | description |
---|---|
cardHolder string | name of your customer |
Example
cardExpiry
A component to accept card expiry
kindinput payablefalseAccepted 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 here
key | description |
---|---|
cardExpiry string | card expiry in MM/YY format |
Example
cardCvv
A component to accept card cvv/cvc
kindinput payablefalseReturned value
You can get the value of a component by calling component.data().value
. All returned values of component.data()
can be found here
key | description |
---|---|
cardCvv number | card cvv |
Example
UPI components
List of UPI components
upiCollect
A component to accept user’s vpa/upi id
kindinput payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
placeholder string OPTIONAL | placeholder for enter vpa field |
upiId string OPTIONAL | 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 here
key | description |
---|---|
upiId string | vpa/ upi id of the customer |
Example
upiApp
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 loaderror
Mobile only. Component will not mount on custom webview/inappbrowser Andoird. 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 options cashfree.create('componentName', options)
key | description |
---|---|
upiApp string Required | name of the upi app |
buttonText string OPTIONAL | Text for button, ex Google Pay for upiApp gpay |
buttonIcon bool OPTIONAL | whether to show app icon or not |
Available options for upiApp
are here
In case bttonText
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 here
key | description |
---|---|
upiApp | name of the upi app |
Example
Example
upiQr
A component to show a UPI qr code
kindimage payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
size string required | 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 here
key | description |
---|---|
size string | size of the qr code. ex “220px” |
Example
Wallet components
Wallet has only one component
wallet
A component to initiate wallet payment.
kindbutton payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
provider string Required | name of the wallet. ex phonepe . All names here |
buttonText string OPTIONAL | Text for button, ex Google Pay for upiApp gpay |
buttonIcon bool OPTIONAL | whether to show app icon or not |
phone string Required | 10 digit phone number of your customer |
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 here
key | description |
---|---|
provider string | name of the wallet. ex phonepe . All names here |
phone string | 10 digit phone number of your customer |
Example
All possible values of provider
can be found here
Netbanking components
Netbanking has only one component
netbanking
A component to initiate Net Banking payment.
kindbutton payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
netbankingBankName string Required | name of the bank. ex HDFCR. See list |
buttonText string OPTIONAL | Text for button, ex Google Pay for upiApp gpay |
buttonIcon bool OPTIONAL | whether to show app icon or not |
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 here
key | description |
---|---|
netbankingBankName string | name of the bank |
Example
All possible values of netbankingBankName
can be found here
Paylater components
Paylater has only one component
paylater
A component to initiate paylater payment.
kindbutton payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
provider string Required | name of the wallet. ex simpl . All names here |
buttonText string OPTIONAL | Text for button, ex Simpl |
buttonIcon bool OPTIONAL | whether to show app icon or not |
phone string Required | 10 digit phone number of your customer |
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 here
key | description |
---|---|
provider string | name of the provider. ex simpl . All names here |
phone string | 10 digit phone number of your customer |
Example
All possible values of provider
can be found here
Cardless EMI components
Paylater has only one component
cardlessEMI
A component to initiate Cardless EMI payment.
kindbutton payabletrueAccepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
provider string Required | name of the wallet. ex flexmoney . All names here |
buttonText string OPTIONAL | Text for button, ex Flexmoney |
buttonIcon bool OPTIONAL | whether to show app icon or not |
phone string Required | 10 digit phone number of your customer |
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 here
key | description |
---|---|
provider string | name of the provider. ex flexmoney . All names here |
phone string | 10 digit phone number of your customer |
Example
All possible values of provider
can be found here
Other Components
savePaymentInstrument
A component that can be used in .pay()
to save a payment method for a customer. This works for only cards. This will tokenize your card
Accepted values
You can pass values to a component using options cashfree.create('componentName', options)
key | description |
---|---|
label string OPTIONAL | 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 here
key | description |
---|---|
saveInstrument bool | does the user wants to save |
Was this page helpful?