Skip to content

Commit

Permalink
Merge pull request #36 from chargebee/feature/logger
Browse files Browse the repository at this point in the history
feat: added logger for hosted page
  • Loading branch information
cb-imayaselvan authored Oct 11, 2021
2 parents e8b1e7b + ce0eb42 commit 2b1ae61
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chargebee/react-native-chargebee",
"version": "1.1.4",
"version": "1.1.5",
"description": "Package for chargebee checkout",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -63,7 +63,8 @@
"react-native": "0.62.0",
"react-native-webview": "11.6.2",
"release-it": "^13.5.8",
"typescript": "^3.8.3"
"typescript": "^3.8.3",
"axios":"^0.22.0"
},
"peerDependencies": {
"react": "*",
Expand Down Expand Up @@ -146,7 +147,8 @@
"typescript"
]
},
"dependencies": {
"dependencies": {
"axios": "^0.22.0",
"lodash": "^4.17.15"
}
}
21 changes: 21 additions & 0 deletions src/components/CheckoutCart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ActivityIndicator, StyleProp, StyleSheet, View } from 'react-native';
import { CBCheckoutProps } from '../interfaces/cb-types';
import { CBCheckout } from '../models/CBCheckout';
import { StepHandler } from '../helpers/StepHandler';
import axios from 'axios';

type CartState = {
planUrl: string;
Expand All @@ -21,6 +22,26 @@ export class CheckoutCart extends Component<CBCheckoutProps, CartState> {
};
}

componentDidMount() {
this.logData();
}

logData() {
axios({
method: 'post',
url: `https://${this.props.site}.chargebee.com/api/internal/track_info_error`,
headers: {
'Content-Type': 'application/json',
},
params: {
ref_module: 'cb_reactNative_sdk',
site: this.props.site,
action: 'Hosted Page',
key: 'cb.logging',
},
});
}

render() {
return (
<View style={styles.wrapper}>
Expand Down

0 comments on commit 2b1ae61

Please sign in to comment.