Skip to content

Commit

Permalink
updated readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekta34 committed Oct 2, 2024
1 parent 9766e97 commit 0534de1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## ct-myinvoice

This package provides a function to create an iframe element with customizable `width`, `height`, `token`, `tin` and `title`, while the `environment` is fixed to a specific URL.
This package provides a function to create an iframe element with customizable `width`, `height`, `token`, `tin`, `callbackFunc` and `title`, while the `environment` is fixed to a specific URL.

## Installation

Expand All @@ -16,6 +16,11 @@ npm install ct-myinvoice
// Import the package
const renderClearCustomerPortal = require('ct-myinvoice');

// Here in data you will get status code
const callbackFunc = (data) => {
console.log(data);
}

// Here you can either send width - height or you can send style object
const iframe = renderClearCustomerPortal({
width: '600',
Expand All @@ -24,6 +29,7 @@ const iframe = renderClearCustomerPortal({
tin: 'XYZ',
title: 'Generate einvoice',
environment: 'sandbox',
callbackFunc: callbackFunc,
});

// Append the iframe to the document body or any element
Expand All @@ -41,6 +47,11 @@ import renderClearCustomerPortal from 'ct-myinvoice';
const ExampleComponent = () => {
const iframeContainerRef = useRef(null);

// Here in data you will get status code
const callbackFunc = (data) => {
console.log(data);
}

useEffect(() => {
// Create the iframe using the package's function
// Here you can either send width - height or you can send style object
Expand All @@ -52,6 +63,7 @@ const ExampleComponent = () => {
title: 'My Custom Iframe',
style: { width: '100%', height: '100%' },
environment: 'sandbox',
callbackFunc: callbackFunc,
});
// Append the iframe to the div container when the component mounts
Expand Down

0 comments on commit 0534de1

Please sign in to comment.