Skip to main content

wallet

A component to show a UPI qr code
wallet
Wallet Object

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
wallet
Wallet Object
let cashfree = Cashfree({
  mode:"sandbox" //or production
});
let wallet = cashfree.create('wallet', {
	values:{
		provider: 'phonepe',
		phone: '94140905',
		buttonText: 'PhonePe',
		buttonIcon: true
	}
});
wallet.on('loaderror', function(data){
	console.log(data.error)
})
wallet.mount("#mount-here");
wallet.on('ready', function(d){
    console.log(wallet.data().value); //{provide: 'phonepe', phone: '94140905'}
    //or
    //console.log(d.value) 
})
 

netbanking

A component to initiate Net Banking payment.
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.
netbanking
Wallet Object

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
netbanking
Netbanking Object
let cashfree = Cashfree({
  mode:"sandbox" //or production
});
let netbanking = cashfree.create('netbanking', {
	values:{
		netbankingBankName: 'HDFCR',
		buttonText: 'HDFC Bank',
		buttonIcon: true
	}
});
netbanking.on('loaderror', function(data){
	console.log(data.error)
})
netbanking.mount("#mount-here");
netbanking.on('ready', function(d){
    console.log(netbanking.data().value); //{netbankingBankName: 'HDFCR'}
    //or
    //console.log(d.value) 
})

paylater

A component to initiate paylater payment.
paylater
Paylater Object

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
paylater
Paylater Object
let cashfree = Cashfree({
  mode:"sandbox" //or production
});
let p = cashfree.create('paylater', {
	values:{
		provider: 'simpl',
		phone: '94140905',
		buttonText: 'Use Simpl',
		buttonIcon: true
	}
});
p.on('loaderror', function(data){
	console.log(data.error)
})
p.mount("#mount-here");
p.on('ready', function(d){
    console.log(d.value) 
})

cardlessEMI

A component to initiate Cardless EMI payment.
cardlessemi
Cardless EMI Object

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
cardlessemi
Cardless EMI Object
let cashfree = Cashfree({
  mode:"sandbox" //or production
});
let cl = cashfree.create('cardlessEMI', {
	values:{
		provider: 'flexmoney',
		phone: '94140905',
		buttonText: 'Flexmoney',
		buttonIcon: true
	}
});
cl.on('loaderror', function(data){
	console.log(data.error)
})
cl.mount("#mount-here");
cl.on('ready', function(d){
    console.log(d.value) 
})

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
savePaymentInstrument
Save Payment Instrument Object

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
savePaymentInstrument
Save Payment Instrument Object
let saveOptions = {
	values: {
		label: "Save Card for later"
	}
};
let savecard = cashfree.create("savePaymentInstrument", saveOptions);
savecard.mount("#div-id");

let cashfree = Cashfree();
.....
cashfree.pay({
...
savePaymentInstrument: savecard
})